Update cypress.yaml (#9262)

This commit is contained in:
Michael Telatynski 2022-09-08 10:05:43 +01:00 committed by GitHub
parent 9050ae4bb7
commit 638175b7d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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