File tree Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Original file line number Diff line number Diff line change 6
6
branches : [main]
7
7
8
8
jobs :
9
+ setup :
10
+ runs-on : ubuntu-latest
11
+ outputs :
12
+ test-chunks : ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
13
+ test-chunk-ids : ${{ steps['set-test-chunk-ids'].outputs['test-chunk-ids'] }}
14
+ steps :
15
+ - uses : actions/checkout@v2
16
+ - run : npm install
17
+ - id : set-test-chunks
18
+ name : Set Chunks
19
+ run :
20
+ echo "::set-output name=test-chunks::$(npx jest -c test/e2e/jest.config.js --listTests --json | jq -cM
21
+ ' [_nwise(length / 10 | floor)]' )"
22
+ - id : set-test-chunk-ids
23
+ name : Set Chunk IDs
24
+ run : echo "::set-output name=test-chunk-ids::$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')"
25
+ env :
26
+ CHUNKS : ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
9
27
test :
10
- name : E2E tests
11
28
runs-on : ubuntu-latest
29
+ name : test (chunk ${{ matrix.chunk }})
30
+ needs :
31
+ - setup
32
+ strategy :
33
+ matrix :
34
+ chunk : ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }}
12
35
steps :
13
36
- uses : actions/checkout@v2
14
- - name : Installing with LTS Node.js
15
- uses : actions/setup-node@v2
16
- with :
17
- node-version : ' lts/*'
18
- - name : NPM Install
19
- run : npm install
20
- - name : Run Next.js e2e test suite
21
- run : npm run test:next
37
+ - run : npm install
38
+ - name : jest
39
+ run : echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs npx jest -c test/e2e/jest.config.js
22
40
env :
41
+ CHUNKS : ${{ needs.setup.outputs['test-chunks'] }}
23
42
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
24
43
NETLIFY_SITE_ID : 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
You can’t perform that action at this time.
0 commit comments