@@ -4,97 +4,102 @@ name: Test all Packages
44# branches)
55
66on :
7- push :
8- branches : [main]
9- pull_request :
7+ push :
8+ branches : [main]
9+ pull_request :
1010
1111# set ESM_DISABLE_CACHE=true (will be JSON parsed)
1212jobs :
1313 build :
1414 runs-on : ubuntu-latest
1515 strategy :
1616 matrix :
17- node-version : ['18.x ']
17+ node-version : ['node-old', 'node-new ']
1818 steps :
19- - uses : actions/checkout@v3
20- with :
21- submodules : ' true'
22- - uses : actions/setup-node@v3
23- with :
24- node-version : ${{ matrix.node-version }}
25- - name : cache node modules
26- uses : actions/cache@v3
27- with :
28- path : ~/.cache/yarn
29- key : ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
30- restore-keys : |
31- ${{ runner.os }}-yarn-
19+ - uses : actions/checkout@v3
20+ with :
21+ submodules : ' true'
22+ - uses : ./.github/actions/setup-node
23+ id : setup-node
24+ with :
25+ node-version : ${{ matrix.node-version }}
26+ - name : cache node modules
27+ uses : actions/cache@v3
28+ with :
29+ path : ~/.cache/yarn
30+ key : ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
31+ restore-keys : |
32+ ${{ runner.os }}-yarn-
3233
33- - run : yarn install
34- - run : yarn build
34+ - run : yarn install
35+ - run : yarn build
3536
36- - name : cache build outputs
37- uses : actions/cache@v3
38- with :
39- path : .
40- key : ${{ runner.os }}-${{ matrix .node-version }}-built-${{ github.sha }}
37+ - name : cache build outputs
38+ uses : actions/cache@v3
39+ with :
40+ path : .
41+ key : ${{ runner.os }}-${{ steps.setup-node.outputs .node-version }}-built-${{ github.sha }}
4142
4243 lint :
4344 needs : build
4445 runs-on : ubuntu-latest
4546 strategy :
4647 matrix :
47- node-version : ['18.x ']
48+ node-version : ['node-old ']
4849 steps :
49- - uses : actions/setup-node@v3
50- with :
51- node-version : ${{ matrix.node-version }}
52- # BEGIN-RESTORE-BOILERPLATE
53- - name : restore built files
54- id : built
55- uses : actions/cache@v3
56- with :
57- path : .
58- key : ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
59- - uses : actions/checkout@v3
60- with :
61- submodules : ' true'
62- if : steps.built.outputs.cache-hit != 'true'
63- - run : yarn install
64- if : steps.built.outputs.cache-hit != 'true'
65- - run : yarn build
66- if : steps.built.outputs.cache-hit != 'true'
67- # END-RESTORE-BOILERPLATE
50+ - uses : actions/checkout@v3
51+ - uses : ./.github/actions/setup-node
52+ id : setup-node
53+ with :
54+ node-version : ${{ matrix.node-version }}
55+ # BEGIN-RESTORE-BOILERPLATE
56+ - name : restore built files
57+ id : built
58+ uses : actions/cache@v3
59+ with :
60+ path : .
61+ key : ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-built-${{ github.sha }}
62+ - uses : actions/checkout@v3
63+ with :
64+ submodules : ' true'
65+ if : steps.built.outputs.cache-hit != 'true'
66+ - run : yarn install
67+ if : steps.built.outputs.cache-hit != 'true'
68+ - run : yarn build
69+ if : steps.built.outputs.cache-hit != 'true'
70+ # END-RESTORE-BOILERPLATE
6871
69- - run : yarn lint
72+ - run : yarn lint
7073
7174 test :
7275 # BEGIN-TEST-BOILERPLATE
7376 needs : build
7477 runs-on : ubuntu-latest
7578 strategy :
7679 matrix :
77- node-version : ['18.x ']
80+ node-version : ['node-old', 'node-new ']
7881 steps :
79- - uses : actions/setup-node@v3
80- with :
81- node-version : ${{ matrix.node-version }}
82- # END-TEST-BOILERPLATE
83- # BEGIN-RESTORE-BOILERPLATE
84- - name : restore built files
85- id : built
86- uses : actions/cache@v3
87- with :
88- path : .
89- key : ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
90- - uses : actions/checkout@v3
91- with :
92- submodules : ' true'
93- if : steps.built.outputs.cache-hit != 'true'
94- - run : yarn install
95- if : steps.built.outputs.cache-hit != 'true'
96- - run : yarn build
97- if : steps.built.outputs.cache-hit != 'true'
98- # END-RESTORE-BOILERPLATE
82+ - uses : actions/checkout@v3
83+ - uses : ./.github/actions/setup-node
84+ id : setup-node
85+ with :
86+ node-version : ${{ matrix.node-version }}
87+ # END-TEST-BOILERPLATE
88+ # BEGIN-RESTORE-BOILERPLATE
89+ - name : restore built files
90+ id : built
91+ uses : actions/cache@v3
92+ with :
93+ path : .
94+ key : ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-built-${{ github.sha }}
95+ - uses : actions/checkout@v3
96+ with :
97+ submodules : ' true'
98+ if : steps.built.outputs.cache-hit != 'true'
99+ - run : yarn install
100+ if : steps.built.outputs.cache-hit != 'true'
101+ - run : yarn build
102+ if : steps.built.outputs.cache-hit != 'true'
103+ # END-RESTORE-BOILERPLATE
99104
100- - run : yarn test
105+ - run : yarn test
0 commit comments