@@ -26,52 +26,28 @@ jobs:
2626 runs-on : ubuntu-latest
2727 strategy :
2828 fail-fast : false
29- # Unit on all Node versions; v5 integration in batches on all Node versions; v4 full suite on 22.
3029 matrix :
31- include :
32- - node-version : 20
33- test : unit
34- - node-version : 22
35- test : unit
36- - node-version : 24
37- test : unit
38- - node-version : 20
39- test : integration:v5:batch1
40- - node-version : 22
41- test : integration:v5:batch1
42- - node-version : 24
43- test : integration:v5:batch1
44- - node-version : 20
45- test : integration:v5:batch2
46- - node-version : 22
47- test : integration:v5:batch2
48- - node-version : 24
49- test : integration:v5:batch2
50- - node-version : 20
51- test : integration:v5:batch3
52- - node-version : 22
53- test : integration:v5:batch3
54- - node-version : 24
55- test : integration:v5:batch3
56- - node-version : 20
57- test : integration:v5:batch4
58- - node-version : 22
59- test : integration:v5:batch4
60- - node-version : 24
61- test : integration:v5:batch4
62- - node-version : 20
63- test : integration:v5:batch5
64- - node-version : 22
65- test : integration:v5:batch5
66- - node-version : 24
67- test : integration:v5:batch5
68- - node-version : 20
69- test : integration:v4
70- - node-version : 22
71- test : integration:v4
72- - node-version : 24
73- test : integration:v4
74- name : Node.js v${{ matrix.node-version }} - ${{ matrix.test }} tests
30+ node-version : [20, 22, 24]
31+ test : [unit, integration:v4, integration:v5:batch]
32+ batch-index : [0, 1, 2, 3, 4]
33+ exclude :
34+ - test : unit
35+ batch-index : 1
36+ - test : unit
37+ batch-index : 2
38+ - test : unit
39+ batch-index : 3
40+ - test : unit
41+ batch-index : 4
42+ - test : integration:v4
43+ batch-index : 1
44+ - test : integration:v4
45+ batch-index : 2
46+ - test : integration:v4
47+ batch-index : 3
48+ - test : integration:v4
49+ batch-index : 4
50+ name : Node.js v${{ matrix.node-version }} - ${{ matrix.test == 'integration:v5:batch' && format('{0}{1}', matrix.test, matrix.batch-index) || matrix.test }} tests
7551 steps :
7652 - name : Checkout
7753 uses : actions/checkout@v4
@@ -83,20 +59,25 @@ jobs:
8359 run : npm ci
8460 - name : Run ${{ matrix.test }} Tests and Add Annotations
8561 id : tests
86- run : npm run test:${{ matrix.test }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit
62+ run : |
63+ if [ "${{ matrix.test }}" = "integration:v5:batch" ]; then
64+ npm run test:integration:v5:batch -- ${{ matrix.batch-index }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit
65+ else
66+ npm run test:${{ matrix.test }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit
67+ fi
8768 env :
8869 ORKES_BACKEND_VERSION : ${{ matrix.test == 'integration:v4' && '4' || (contains(matrix.test, 'integration:v5') && '5' || '') }}
8970 CONDUCTOR_SERVER_URL : ${{ matrix.test == 'integration:v4' && vars.SERVER_URL_V4 || (contains(matrix.test, 'integration') && vars.SERVER_URL || '') }}
9071 CONDUCTOR_AUTH_KEY : ${{ matrix.test == 'integration:v4' && secrets.AUTH_KEY_V4 || (contains(matrix.test, 'integration') && secrets.AUTH_KEY || '') }}
9172 CONDUCTOR_AUTH_SECRET : ${{ matrix.test == 'integration:v4' && secrets.AUTH_SECRET_V4 || (contains(matrix.test, 'integration') && secrets.AUTH_SECRET || '') }}
9273 CONDUCTOR_SDK_INITIAL_TOKEN_STAGGER_MS : ${{ (matrix.test == 'integration:v4' || contains(matrix.test, 'integration')) && '2000' || '' }}
93- JEST_JUNIT_OUTPUT_NAME : ${{ matrix.test } }-node-${{ matrix.node-version } }-test-results.xml
94- - name : Publish ${{ matrix.test }} Test Results
74+ JEST_JUNIT_OUTPUT_NAME : ${{ matrix.test == 'integration:v5:batch' && format('{0}{1 }-node-{2}-test-results.xml', matrix.test, matrix.batch-index, matrix. node-version) || format('{0}-node-{1 }-test-results.xml', matrix.test, matrix.node-version) }}
75+ - name : Publish Test Results
9576 uses : dorny/test-reporter@v2
9677 if : ${{ !cancelled() }}
9778 with :
98- name : ${{ matrix.test } } (Node ${{ matrix.node-version }})
99- path : reports/${{ matrix.test } }-node-${{ matrix.node-version } }-test-results.xml
79+ name : ${{ matrix.test == 'integration:v5:batch' && format('{0}{1 } (Node {2})', matrix.test, matrix.batch-index, matrix. node-version) || format('{0} (Node {1})', matrix.test, matrix.node-version) }}
80+ path : reports/${{ matrix.test == 'integration:v5:batch' && format('{0}{1 }-node-{2}-test-results.xml', matrix.test, matrix.batch-index, matrix. node-version) || format('{0}-node-{1 }-test-results.xml', matrix.test, matrix.node-version) }}
10081 reporter : jest-junit
10182 - name : Upload coverage to Codecov
10283 if : always()
0 commit comments