|
7 | 7 | paths-ignore:
|
8 | 8 | - 'compiler/**'
|
9 | 9 |
|
10 |
| -env: |
11 |
| - # Number of workers (one per shard) to spawn |
12 |
| - SHARD_COUNT: 5 |
13 |
| - |
14 | 10 | 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 |
62 | 11 | test:
|
63 |
| - name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard_id }}) |
| 12 | + name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard }}) |
64 | 13 | runs-on: ubuntu-latest
|
65 |
| - needs: build_test_params |
66 | 14 | strategy:
|
67 | 15 | 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 |
70 | 42 | continue-on-error: true
|
71 | 43 | steps:
|
72 | 44 | - uses: actions/checkout@v4
|
|
82 | 54 | path: "**/node_modules"
|
83 | 55 | key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
|
84 | 56 | - 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