66 types :
77 - completed
88jobs :
9- # This job cannot have a pretty name due to https://github.com/haya14busa/action-workflow_run-status/issues/158
10- cypress :
9+ prepare :
10+ name : Prepare
1111 if : github.event.workflow_run.conclusion == 'success'
1212 runs-on : ubuntu-latest
1313 permissions :
1414 actions : read
15- statuses : write
1615 issues : read
1716 pull-requests : read
1817 outputs :
2322 commit_email : ${{ steps.commit.outputs.email }}
2423 percy_enable : ${{ steps.percy.outputs.value || '1' }}
2524 steps :
26- # Wire up the status check for this workflow_run action
27- - uses : haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 # v1.0.0
28-
2925 - id : prdetails
3026 if : github.event.workflow_run.event == 'pull_request'
3127 uses :
matrix-org/[email protected] 6258
6359 tests :
6460 name : " Run Tests"
65- needs : cypress
61+ needs : prepare
6662 runs-on : ubuntu-latest
6763 permissions :
6864 actions : read
@@ -106,7 +102,7 @@ jobs:
106102 record : true
107103 parallel : true
108104 command-prefix : ' yarn percy exec --parallel --'
109- ci-build-id : ${{ needs.cypress .outputs.uuid }}
105+ ci-build-id : ${{ needs.prepare .outputs.uuid }}
110106 env :
111107 # pass the Dashboard record key as an environment variable
112108 CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
@@ -124,20 +120,20 @@ jobs:
124120 COMMIT_INFO_BRANCH : ${{ github.event.workflow_run.head_branch }}
125121 COMMIT_INFO_SHA : ${{ github.event.workflow_run.head_sha }}
126122 COMMIT_INFO_REMOTE : ${{ github.repositoryUrl }}
127- COMMIT_INFO_MESSAGE : ${{ needs.cypress .outputs.commit_message }}
128- COMMIT_INFO_AUTHOR : ${{ needs.cypress .outputs.commit_author }}
129- COMMIT_INFO_EMAIL : ${{ needs.cypress .outputs.commit_email }}
123+ COMMIT_INFO_MESSAGE : ${{ needs.prepare .outputs.commit_message }}
124+ COMMIT_INFO_AUTHOR : ${{ needs.prepare .outputs.commit_author }}
125+ COMMIT_INFO_EMAIL : ${{ needs.prepare .outputs.commit_email }}
130126
131127 # pass the Percy token as an environment variable
132128 PERCY_TOKEN : ${{ secrets.PERCY_TOKEN }}
133- PERCY_ENABLE : ${{ needs.cypress .outputs.percy_enable }}
129+ PERCY_ENABLE : ${{ needs.prepare .outputs.percy_enable }}
134130 PERCY_BROWSER_EXECUTABLE : /usr/bin/chromium-browser
135131 # tell Percy more details about the context of this run
136132 PERCY_BRANCH : ${{ github.event.workflow_run.head_branch }}
137133 PERCY_COMMIT : ${{ github.event.workflow_run.head_sha }}
138- PERCY_PULL_REQUEST : ${{ needs.cypress .outputs.pr_id }}
134+ PERCY_PULL_REQUEST : ${{ needs.prepare .outputs.pr_id }}
139135 PERCY_PARALLEL_TOTAL : ${{ strategy.job-total }}
140- PERCY_PARALLEL_NONCE : ${{ needs.cypress .outputs.uuid }}
136+ PERCY_PARALLEL_NONCE : ${{ needs.prepare .outputs.uuid }}
141137
142138 - name : Upload Artifact
143139 if : failure()
@@ -160,6 +156,22 @@ jobs:
160156 if-no-files-found : ignore
161157 retention-days : 1
162158
159+
160+ # This job cannot have a pretty name due to https://github.com/haya14busa/action-workflow_run-status/issues/158
161+ cypress :
162+ needs : tests
163+ runs-on : ubuntu-latest
164+ if : always()
165+ permissions :
166+ statuses : write
167+ steps :
168+ # Wire up the status check for this workflow_run action
169+ - uses : haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 # v1.0.0
170+
171+ - name : Check status
172+ if : ${{ needs.tests.result != 'success' }}
173+ run : exit 1
174+
163175 store-benchmark :
164176 needs : tests
165177 runs-on : ubuntu-latest
0 commit comments