7
7
prepare :
8
8
name : Prepare
9
9
runs-on : ubuntu-latest
10
+ strategy :
11
+ matrix :
12
+ node-version : [18.x, 20.x, 22.x]
10
13
steps :
11
- - uses : actions/checkout@v4
12
- - name : Use Node.js
13
- uses : actions/setup-node@v4
14
+ - name : Checkout and setup environment
15
+ uses : MetaMask/action-checkout-and-setup@v1
14
16
with :
15
- node-version-file : ' .nvmrc'
16
- cache : ' yarn'
17
- - name : Install Yarn dependencies
18
- run : yarn --immutable
17
+ is-high-risk-environment : false
18
+ node-version : ${{ matrix.node-version }}
19
+ cache-node-modules : ${{ matrix.node-version == '22.x' }}
19
20
20
21
build :
21
22
name : Build
23
+ needs : prepare
22
24
runs-on : ubuntu-latest
23
- needs :
24
- - prepare
25
+ strategy :
26
+ matrix :
27
+ node-version : [22.x]
25
28
steps :
26
- - uses : actions/checkout@v4
27
- - name : Use Node.js
28
- uses : actions/setup-node@v4
29
+ - name : Checkout and setup environment
30
+ uses : MetaMask/action-checkout-and-setup@v1
29
31
with :
30
- node-version-file : ' .nvmrc'
31
- cache : ' yarn'
32
- - run : yarn --immutable --immutable-cache
32
+ is-high-risk-environment : false
33
+ node-version : ${{ matrix.node-version }}
33
34
- run : yarn build
34
35
- name : Require clean working directory
35
36
shell : bash
@@ -41,17 +42,17 @@ jobs:
41
42
42
43
lint :
43
44
name : Lint
45
+ needs : prepare
44
46
runs-on : ubuntu-latest
45
- needs :
46
- - prepare
47
+ strategy :
48
+ matrix :
49
+ node-version : [22.x]
47
50
steps :
48
- - uses : actions/checkout@v4
49
- - name : Use Node.js
50
- uses : actions/setup-node@v4
51
+ - name : Checkout and setup environment
52
+ uses : MetaMask/action-checkout-and-setup@v1
51
53
with :
52
- node-version-file : ' .nvmrc'
53
- cache : ' yarn'
54
- - run : yarn --immutable --immutable-cache
54
+ is-high-risk-environment : false
55
+ node-version : ${{ matrix.node-version }}
55
56
- run : yarn lint
56
57
- name : Validate RC changelog
57
58
if : ${{ startsWith(github.head_ref, 'release/') }}
@@ -69,20 +70,17 @@ jobs:
69
70
70
71
test :
71
72
name : Test
73
+ needs : prepare
72
74
runs-on : ubuntu-latest
73
- needs :
74
- - prepare
75
75
strategy :
76
76
matrix :
77
- node-version : [18.x, 20.x]
77
+ node-version : [18.x, 20.x, 22.x ]
78
78
steps :
79
- - uses : actions/checkout@v4
80
- - name : Use Node.js ${{ matrix.node-version }}
81
- uses : actions/setup-node@v4
79
+ - name : Checkout and setup environment
80
+ uses : MetaMask/action-checkout-and-setup@v1
82
81
with :
82
+ is-high-risk-environment : false
83
83
node-version : ${{ matrix.node-version }}
84
- cache : ' yarn'
85
- - run : yarn --immutable --immutable-cache
86
84
- run : yarn test
87
85
- name : Require clean working directory
88
86
shell : bash
@@ -94,25 +92,25 @@ jobs:
94
92
95
93
compatibility-test :
96
94
name : Compatibility test
95
+ needs : prepare
97
96
runs-on : ubuntu-latest
98
- needs :
99
- - prepare
100
97
strategy :
101
98
matrix :
102
- node-version : [18.x, 20.x]
99
+ node-version : [18.x, 20.x, 22.x ]
103
100
steps :
104
- - uses : actions/checkout@v4
105
- - name : Use Node.js ${{ matrix.node-version }}
106
- uses : actions/setup-node@v4
101
+ - name : Checkout and setup environment
102
+ uses : MetaMask/action-checkout-and-setup@v1
107
103
with :
104
+ is-high-risk-environment : false
108
105
node-version : ${{ matrix.node-version }}
109
- cache : ' yarn '
110
- - run : rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
106
+ - name : Install dependencies via Yarn
107
+ run : rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
111
108
- run : yarn test
109
+ - name : Restore lockfile
110
+ run : git restore yarn.lock
112
111
- name : Require clean working directory
113
112
shell : bash
114
113
run : |
115
- git restore yarn.lock
116
114
if ! git diff --exit-code; then
117
115
echo "Working tree dirty at end of job"
118
116
exit 1
0 commit comments