Skip to content

Commit 9cfde60

Browse files
eth3lbertTurbo87
authored andcommitted
CI: Enable parallel test suites for percy
1 parent b325504 commit 9cfde60

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ jobs:
6868
non-rust: ${{ steps.changed-files-non-rust.outputs.any_modified }}
6969
rust-lockfile: ${{ steps.changed-files-rust-lockfile.outputs.any_modified }}
7070

71+
percy-nonce:
72+
runs-on: ubuntu-latest
73+
# persist job results to other jobs in the workflow
74+
outputs:
75+
nonce: ${{ steps.percy-nonce.outputs.nonce }}
76+
steps:
77+
# persist step results to other steps in the job
78+
- id: percy-nonce
79+
# adding a timestamp makes the nonce more unique for re-runs
80+
run: echo "nonce=${{ github.run_id }}-$(date +%s)" >> $GITHUB_OUTPUT
81+
7182
backend-lint:
7283
name: Backend / Lint
7384
runs-on: ubuntu-22.04
@@ -177,7 +188,7 @@ jobs:
177188
frontend-test:
178189
name: Frontend / Test
179190
runs-on: ubuntu-22.04
180-
needs: changed-files
191+
needs: [changed-files, percy-nonce]
181192
if: needs.changed-files.outputs.non-rust == 'true'
182193

183194
env:
@@ -186,6 +197,8 @@ jobs:
186197
# Percy secrets are included here to enable Percy's GitHub integration
187198
# on community-submitted PRs
188199
PERCY_TOKEN: web_0a783d8086b6f996809f3e751d032dd6d156782082bcd1423b9b860113c75054
200+
PERCY_PARALLEL_NONCE: ${{ needs.percy-nonce.outputs.nonce }}
201+
PERCY_PARALLEL_TOTAL: 2
189202

190203
steps:
191204
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -202,15 +215,15 @@ jobs:
202215
- run: pnpm install
203216

204217
- if: github.repository == 'rust-lang/crates.io'
205-
run: pnpm percy exec -- pnpm test-coverage
218+
run: pnpm percy exec --parallel -- pnpm test-coverage
206219

207220
- if: github.repository != 'rust-lang/crates.io'
208221
run: pnpm test-coverage
209222

210223
e2e-test:
211224
name: Frontend / Test (playwright)
212225
runs-on: ubuntu-22.04
213-
needs: changed-files
226+
needs: [changed-files, percy-nonce]
214227
timeout-minutes: 60
215228
if: needs.changed-files.outputs.non-rust == 'true'
216229

@@ -220,6 +233,8 @@ jobs:
220233
# Percy secrets are included here to enable Percy's GitHub integration
221234
# on community-submitted PRs
222235
PERCY_TOKEN: web_0a783d8086b6f996809f3e751d032dd6d156782082bcd1423b9b860113c75054
236+
PERCY_PARALLEL_NONCE: ${{ needs.percy-nonce.outputs.nonce }}
237+
PERCY_PARALLEL_TOTAL: 2
223238

224239
steps:
225240
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -238,7 +253,7 @@ jobs:
238253
- run: pnpm playwright install chromium
239254

240255
- if: github.repository == 'rust-lang/crates.io'
241-
run: pnpm percy exec -- pnpm e2e
256+
run: pnpm percy exec --parallel -- pnpm e2e
242257

243258
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
244259
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)