Skip to content

Commit 8ae78f3

Browse files
authored
CI: reduce job waterfall for runtime test jobs (#30303)
The first job was just printing static JSON. This simplifies the job config a bit and allows the test jobs to start earlier.
1 parent 14fdd0e commit 8ae78f3

File tree

1 file changed

+28
-56
lines changed

1 file changed

+28
-56
lines changed

.github/workflows/runtime_test.yml

+28-56
Original file line numberDiff line numberDiff line change
@@ -7,66 +7,38 @@ on:
77
paths-ignore:
88
- 'compiler/**'
99

10-
env:
11-
# Number of workers (one per shard) to spawn
12-
SHARD_COUNT: 5
13-
1410
jobs:
15-
# Define the various test parameters and parallelism for this workflow
16-
build_test_params:
17-
name: Build test params
18-
runs-on: ubuntu-latest
19-
outputs:
20-
params: ${{ steps.define-params.outputs.result }}
21-
shard_id: ${{ steps.define-shards.outputs.result }}
22-
steps:
23-
- uses: actions/github-script@v7
24-
id: define-shards
25-
with:
26-
script: |
27-
function range(from, to) {
28-
const arr = [];
29-
for (let n = from; n <= to; n++) {
30-
arr.push(n);
31-
}
32-
return arr;
33-
}
34-
return range(1, process.env.SHARD_COUNT);
35-
- uses: actions/github-script@v7
36-
id: define-params
37-
with:
38-
script: |
39-
return [
40-
"-r=stable --env=development",
41-
"-r=stable --env=production",
42-
"-r=experimental --env=development",
43-
"-r=experimental --env=production",
44-
"-r=www-classic --env=development --variant=false",
45-
"-r=www-classic --env=production --variant=false",
46-
"-r=www-classic --env=development --variant=true",
47-
"-r=www-classic --env=production --variant=true",
48-
"-r=www-modern --env=development --variant=false",
49-
"-r=www-modern --env=production --variant=false",
50-
"-r=www-modern --env=development --variant=true",
51-
"-r=www-modern --env=production --variant=true",
52-
"-r=xplat --env=development --variant=false",
53-
"-r=xplat --env=development --variant=true",
54-
"-r=xplat --env=production --variant=false",
55-
"-r=xplat --env=production --variant=true",
56-
// TODO: Test more persistent configurations?
57-
"-r=stable --env=development --persistent",
58-
"-r=experimental --env=development --persistent"
59-
];
60-
61-
# Spawn a job for each shard for a given set of test params
6211
test:
63-
name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard_id }})
12+
name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard }})
6413
runs-on: ubuntu-latest
65-
needs: build_test_params
6614
strategy:
6715
matrix:
68-
params: ${{ fromJSON(needs.build_test_params.outputs.params) }}
69-
shard_id: ${{ fromJSON(needs.build_test_params.outputs.shard_id) }}
16+
params:
17+
- "-r=stable --env=development"
18+
- "-r=stable --env=production"
19+
- "-r=experimental --env=development"
20+
- "-r=experimental --env=production"
21+
- "-r=www-classic --env=development --variant=false"
22+
- "-r=www-classic --env=production --variant=false"
23+
- "-r=www-classic --env=development --variant=true"
24+
- "-r=www-classic --env=production --variant=true"
25+
- "-r=www-modern --env=development --variant=false"
26+
- "-r=www-modern --env=production --variant=false"
27+
- "-r=www-modern --env=development --variant=true"
28+
- "-r=www-modern --env=production --variant=true"
29+
- "-r=xplat --env=development --variant=false"
30+
- "-r=xplat --env=development --variant=true"
31+
- "-r=xplat --env=production --variant=false"
32+
- "-r=xplat --env=production --variant=true"
33+
# TODO: Test more persistent configurations?
34+
- "-r=stable --env=development --persistent"
35+
- "-r=experimental --env=development --persistent"
36+
shard:
37+
- 1/5
38+
- 2/5
39+
- 3/5
40+
- 4/5
41+
- 5/5
7042
continue-on-error: true
7143
steps:
7244
- uses: actions/checkout@v4
@@ -82,4 +54,4 @@ jobs:
8254
path: "**/node_modules"
8355
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
8456
- run: yarn install --frozen-lockfile
85-
- run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard_id }}/${{ env.SHARD_COUNT }}
57+
- run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}

0 commit comments

Comments
 (0)