diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 4482afcc0b..f98ff1d3af 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -6,13 +6,12 @@ on: types: - completed jobs: - # This job cannot have a pretty name due to https://github.com/haya14busa/action-workflow_run-status/issues/158 - cypress: + prepare: + name: Prepare if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest permissions: actions: read - statuses: write issues: read pull-requests: read outputs: @@ -23,9 +22,6 @@ jobs: commit_email: ${{ steps.commit.outputs.email }} percy_enable: ${{ steps.percy.outputs.value || '1' }} steps: - # Wire up the status check for this workflow_run action - - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 # v1.0.0 - - id: prdetails if: github.event.workflow_run.event == 'pull_request' uses: matrix-org/pr-details-action@v1.2 @@ -62,7 +58,7 @@ jobs: tests: name: "Run Tests" - needs: cypress + needs: prepare runs-on: ubuntu-latest permissions: actions: read @@ -106,7 +102,7 @@ jobs: record: true parallel: true command-prefix: 'yarn percy exec --parallel --' - ci-build-id: ${{ needs.cypress.outputs.uuid }} + ci-build-id: ${{ needs.prepare.outputs.uuid }} env: # pass the Dashboard record key as an environment variable CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} @@ -124,20 +120,20 @@ jobs: COMMIT_INFO_BRANCH: ${{ github.event.workflow_run.head_branch }} COMMIT_INFO_SHA: ${{ github.event.workflow_run.head_sha }} COMMIT_INFO_REMOTE: ${{ github.repositoryUrl }} - COMMIT_INFO_MESSAGE: ${{ needs.cypress.outputs.commit_message }} - COMMIT_INFO_AUTHOR: ${{ needs.cypress.outputs.commit_author }} - COMMIT_INFO_EMAIL: ${{ needs.cypress.outputs.commit_email }} + COMMIT_INFO_MESSAGE: ${{ needs.prepare.outputs.commit_message }} + COMMIT_INFO_AUTHOR: ${{ needs.prepare.outputs.commit_author }} + COMMIT_INFO_EMAIL: ${{ needs.prepare.outputs.commit_email }} # pass the Percy token as an environment variable PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - PERCY_ENABLE: ${{ needs.cypress.outputs.percy_enable }} + PERCY_ENABLE: ${{ needs.prepare.outputs.percy_enable }} PERCY_BROWSER_EXECUTABLE: /usr/bin/chromium-browser # tell Percy more details about the context of this run PERCY_BRANCH: ${{ github.event.workflow_run.head_branch }} PERCY_COMMIT: ${{ github.event.workflow_run.head_sha }} - PERCY_PULL_REQUEST: ${{ needs.cypress.outputs.pr_id }} + PERCY_PULL_REQUEST: ${{ needs.prepare.outputs.pr_id }} PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }} - PERCY_PARALLEL_NONCE: ${{ needs.cypress.outputs.uuid }} + PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }} - name: Upload Artifact if: failure() @@ -160,6 +156,22 @@ jobs: if-no-files-found: ignore retention-days: 1 + + # This job cannot have a pretty name due to https://github.com/haya14busa/action-workflow_run-status/issues/158 + cypress: + needs: tests + runs-on: ubuntu-latest + if: always() + permissions: + statuses: write + steps: + # Wire up the status check for this workflow_run action + - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 # v1.0.0 + + - name: Check status + if: ${{ needs.tests.result != 'success' }} + run: exit 1 + store-benchmark: needs: tests runs-on: ubuntu-latest