Skip to content

Commit 0e18014

Browse files
authored
[ci] Separate DevTools test-build into dedicated job with fewer shards (#35457)
DevTools has ~45 test files which don't distribute well across 10 shards, causing shard 3 to run 2x slower than others (104s vs ~50s). This moves DevTools build tests to a separate job with 3 shards for better load balancing.
1 parent 65eec42 commit 0e18014

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,6 @@ jobs:
382382
-r=experimental --env=development,
383383
-r=experimental --env=production,
384384

385-
# Dev Tools
386-
--project=devtools -r=experimental,
387-
388385
# TODO: Update test config to support www build tests
389386
# - "-r=www-classic --env=development --variant=false"
390387
# - "-r=www-classic --env=production --variant=false"
@@ -450,6 +447,48 @@ jobs:
450447
run: ls -R build
451448
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci
452449

450+
test_build_devtools:
451+
name: yarn test-build (devtools)
452+
needs: [build_and_lint, runtime_node_modules_cache]
453+
strategy:
454+
fail-fast: false
455+
matrix:
456+
shard:
457+
- 1/3
458+
- 2/3
459+
- 3/3
460+
runs-on: ubuntu-latest
461+
steps:
462+
- uses: actions/checkout@v4
463+
with:
464+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
465+
- uses: actions/setup-node@v4
466+
with:
467+
node-version-file: '.nvmrc'
468+
cache: yarn
469+
cache-dependency-path: yarn.lock
470+
- name: Restore cached node_modules
471+
uses: actions/cache/restore@v4
472+
id: node_modules
473+
with:
474+
path: |
475+
**/node_modules
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
478+
- name: Ensure clean build directory
479+
run: rm -rf build
480+
- run: yarn install --frozen-lockfile
481+
if: steps.node_modules.outputs.cache-hit != 'true'
482+
- name: Restore archived build
483+
uses: actions/download-artifact@v4
484+
with:
485+
pattern: _build_*
486+
path: build
487+
merge-multiple: true
488+
- name: Display structure of build
489+
run: ls -R build
490+
- run: yarn test --build --project=devtools -r=experimental --shard=${{ matrix.shard }} --ci
491+
453492
process_artifacts_combined:
454493
name: Process artifacts combined
455494
needs: [build_and_lint, runtime_node_modules_cache]

0 commit comments

Comments
 (0)