From e2ccfd0b4f53293f9dea0e82c8e76dedf0a530ac Mon Sep 17 00:00:00 2001 From: splincode Date: Wed, 25 Sep 2024 14:35:03 +0300 Subject: [PATCH] ci: cleanup workflow yml files --- .github/workflows/auto-author-assign.yml | 16 -------- .github/workflows/auto-label.yml | 17 -------- .github/workflows/build.yml | 4 +- .github/workflows/deploy-preview.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/e2e.yml | 10 ++--- .github/workflows/lint.yml | 10 ++--- .../workflows/{auto-approve.yml => pr.yml} | 41 +++++++++++++++---- .github/workflows/release.yml | 4 +- .github/workflows/test.yml | 4 +- 10 files changed, 52 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/auto-author-assign.yml delete mode 100644 .github/workflows/auto-label.yml rename .github/workflows/{auto-approve.yml => pr.yml} (50%) diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml deleted file mode 100644 index 95f41e046..000000000 --- a/.github/workflows/auto-author-assign.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 🤖 Auto assign -on: - pull_request: - types: [opened, reopened] - -jobs: - assign-author: - name: PR author as an assignee - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 - - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - - uses: toshimaru/auto-author-assign@v2.1.1 - if: env.IS_OWNER_MODE == 'true' - with: - repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml deleted file mode 100644 index d57ed7d77..000000000 --- a/.github/workflows/auto-label.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 🤖 Auto label -on: - pull_request_review: - types: [submitted] - -jobs: - label-when-approved: - if: github.event.review.state == 'APPROVED' - name: Label when approved - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 - - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - - uses: taiga-family/ci/actions/auto/label-when-approved@v1.85.0 - with: - approvals: 1 - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0552e5d9b..0dd99b3bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: name: Packages runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npx nx run-many --target build --all --exclude=demo @@ -18,7 +18,7 @@ jobs: name: Demo runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npx nx build-gh-pages diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 38ffefcb0..869bbaf2b 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -7,7 +7,7 @@ jobs: name: Firebase runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b8805a87..0736a8184 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest if: "contains(github.event.head_commit.message, 'chore(release)')" steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npx nx build-gh-pages diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c7b02e7ce..8486a3a8b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -12,7 +12,7 @@ jobs: name: Build demo runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 with: fetch-depth: 10 @@ -42,7 +42,7 @@ jobs: project: [date, date-range, date-time, number, time] name: Kit / ${{ matrix.project }} steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 @@ -67,7 +67,7 @@ jobs: runs-on: ubuntu-latest name: Recipes steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-latest name: Others steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 @@ -116,7 +116,7 @@ jobs: runs-on: ubuntu-latest name: Component Testing steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2281cc243..ccc50e016 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ jobs: typecheck: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run typecheck @@ -13,7 +13,7 @@ jobs: cspell: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run cspell -- --no-progress @@ -21,7 +21,7 @@ jobs: prettier: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run prettier ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --write' || '-- --check' }} @@ -32,7 +32,7 @@ jobs: stylelint: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run stylelint ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --fix' || '' }} @@ -43,7 +43,7 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - run: npm run lint ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --fix' || '' }} diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/pr.yml similarity index 50% rename from .github/workflows/auto-approve.yml rename to .github/workflows/pr.yml index 8c99f2f4d..55eb04475 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/pr.yml @@ -1,5 +1,8 @@ -name: 🤖 Auto approve validation -on: pull_request +name: 🤖 PR suites +on: + pull_request: + pull_request_review: + types: [submitted] env: PR_JOBS_NAME: '[ "Packages", "Demo", "Firebase", "Lint result", "tests", "E2E result" ]' @@ -10,10 +13,11 @@ jobs: outputs: matrix: ${{ steps.matrix.outputs.value }} steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - id: matrix - run: echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT + if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' + run: echo "value=$JOBS_NAME" >> $GITHUB_OUTPUT wait: needs: [setup] @@ -32,7 +36,7 @@ jobs: needs: [wait] runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/auto/approve/double@v1.85.0 if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' @@ -40,10 +44,33 @@ jobs: token1: ${{ secrets.GITHUB_TOKEN }} token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} - uses: taiga-family/ci/actions/run/merge@v1.85.0 - if: ${{ env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' }} + if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' with: token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + label-when-approved: + name: Label when approved + runs-on: ubuntu-latest + if: github.event.review.state == 'APPROVED' + steps: + - uses: actions/checkout@v4.1.7 + - uses: taiga-family/ci/actions/setup/variables@v1.85.0 + - uses: taiga-family/ci/actions/auto/label-when-approved@v1.85.0 + with: + approvals: 1 + token: ${{ secrets.GITHUB_TOKEN }} + + assign-author: + name: PR author as an assignee + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + - uses: taiga-family/ci/actions/setup/variables@v1.85.0 + - uses: toshimaru/auto-author-assign@v2.1.1 + if: env.IS_OWNER_MODE == 'true' + with: + repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + concurrency: - group: auto-approve-${{ github.head_ref }} + group: pr-suites-${{ github.head_ref }} cancel-in-progress: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2caf843c0..46f6e1644 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 - uses: taiga-family/ci/actions/run/release-it@v1.85.0 @@ -36,7 +36,7 @@ jobs: chatId: ${{ secrets.TAIGA_TELEGRAM_CHAT_ID }} topicId: ${{ secrets.TAIGA_TELEGRAM_CHAT_THREAD_ID }} token: ${{ secrets.TAIGA_TELEGRAM_BOT_TOKEN }} - version: ${{ steps.info.outputs.version }} + version: v${{ steps.info.outputs.version }} textLink: '@maskito/core' concurrency: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f1d785f7a..814186ca9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: taiga-family/ci/actions/setup/variables@v1.85.0 - uses: taiga-family/ci/actions/setup/node@v1.85.0 @@ -28,7 +28,7 @@ jobs: needs: [tests] runs-on: ubuntu-latest steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.85.0 + - uses: actions/checkout@v4.1.7 - uses: actions/download-artifact@v4.1.8 with: name: coverage-${{ github.workflow }}-${{ github.run_id }}