Skip to content

Commit 658d9af

Browse files
ci: shard the Test job by package group (#4286)
* ci: shard the Test job by package group * ci: keep support shard history for ratchet
1 parent 53153d4 commit 658d9af

1 file changed

Lines changed: 71 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 71 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -338,21 +338,13 @@ jobs:
338338
- run: bun run --filter '*' typecheck
339339
- run: bun run typecheck:scripts
340340

341-
test:
342-
name: Test
343-
needs: [changes, producer-source-tests]
344-
# Keep the existing required `Test` context authoritative for producer
345-
# failures too. The dedicated producer matrix remains parallel and legible,
346-
# while this job fails closed if either lane fails or is cancelled.
347-
if: always() && needs.changes.outputs.code == 'true'
341+
test-studio:
342+
name: Test (studio)
343+
needs: changes
344+
if: needs.changes.outputs.code == 'true'
348345
runs-on: ubuntu-latest
349346
timeout-minutes: 10
350347
steps:
351-
- name: Require producer source tests
352-
if: needs.producer-source-tests.result != 'success'
353-
run: |
354-
echo "::error::Producer unit/integration tests did not succeed."
355-
exit 1
356348
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
357349
with:
358350
lfs: true
@@ -368,9 +360,51 @@ jobs:
368360
- run: bun run --filter '@hyperframes/{parsers,lint,studio-server}' build
369361
- run: bun run --cwd packages/core build
370362
- run: bun run --cwd packages/core build:hyperframes-runtime
371-
# After the builds: the preview scripts drive the producer, which imports
372-
# @hyperframes/core from dist, so running these first fails on a missing
373-
# module rather than on anything the test is actually checking.
363+
- run: bun run --cwd packages/studio test
364+
365+
test-runtime:
366+
name: Test (runtime)
367+
needs: changes
368+
if: needs.changes.outputs.code == 'true'
369+
runs-on: ubuntu-latest
370+
timeout-minutes: 10
371+
steps:
372+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
373+
with:
374+
lfs: true
375+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
376+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
377+
with:
378+
node-version: 22
379+
- uses: ./.github/actions/install-ffmpeg-linux
380+
- uses: ./.github/actions/prepare-ffmpeg-bin
381+
- run: bash scripts/ci/install-workspace-dependencies.sh
382+
- run: bun run --filter '@hyperframes/{parsers,lint,studio-server}' build
383+
- run: bun run --cwd packages/core build
384+
- run: bun run --cwd packages/core build:hyperframes-runtime
385+
- run: bun run --filter '@hyperframes/{cli,core,engine}' test
386+
387+
test-support:
388+
name: Test (support)
389+
needs: changes
390+
if: needs.changes.outputs.code == 'true'
391+
runs-on: ubuntu-latest
392+
timeout-minutes: 10
393+
steps:
394+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
395+
with:
396+
lfs: true
397+
fetch-depth: 0
398+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
399+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
400+
with:
401+
node-version: 22
402+
- uses: ./.github/actions/install-ffmpeg-linux
403+
- uses: ./.github/actions/prepare-ffmpeg-bin
404+
- run: bash scripts/ci/install-workspace-dependencies.sh
405+
- run: bun run --filter '@hyperframes/{parsers,lint,studio-server}' build
406+
- run: bun run --cwd packages/core build
407+
- run: bun run --cwd packages/core build:hyperframes-runtime
374408
- name: Install Chrome for catalog preview tests
375409
id: catalog-chrome
376410
uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce # v1
@@ -379,7 +413,28 @@ jobs:
379413
- run: bun run test:scripts
380414
env:
381415
HYPERFRAMES_BROWSER_PATH: ${{ steps.catalog-chrome.outputs.chrome-path }}
382-
- run: bun run --filter '!@hyperframes/producer' test
416+
- run: bun run --filter '@hyperframes/{lint,parsers,studio-server,sdk,player,aws-lambda,gcp-cloud-run,sdk-playground,shader-transitions}' test
417+
418+
test:
419+
name: Test
420+
needs: [changes, producer-source-tests, test-studio, test-runtime, test-support]
421+
# Keep the existing required `Test` context authoritative for producer
422+
# failures too. It also fails closed if any package shard fails or is cancelled.
423+
if: always() && needs.changes.outputs.code == 'true'
424+
runs-on: ubuntu-latest
425+
timeout-minutes: 3
426+
steps:
427+
- name: Require producer source tests
428+
if: needs.producer-source-tests.result != 'success'
429+
run: |
430+
echo "::error::Producer unit/integration tests did not succeed."
431+
exit 1
432+
- name: Require package test shards
433+
if: needs.test-studio.result != 'success' || needs.test-runtime.result != 'success' || needs.test-support.result != 'success'
434+
run: |
435+
echo "::error::A package test shard did not succeed."
436+
echo "studio=${{ needs.test-studio.result }} runtime=${{ needs.test-runtime.result }} support=${{ needs.test-support.result }}"
437+
exit 1
383438
384439
producer-source-tests:
385440
name: "Producer: ${{ matrix.lane }} tests"

0 commit comments

Comments
 (0)