12
12
CI : true
13
13
FORCE_COLOR : 2
14
14
15
-
16
15
jobs :
17
- run :
18
- name : Node ${{ matrix.node }} on ${{ matrix.os }}
16
+ pipeline :
17
+ name : Node ${{ matrix.node-version }} on ${{ matrix.os }}
19
18
runs-on : ${{ matrix.os }}
20
19
21
20
strategy :
22
21
fail-fast : false
23
22
matrix :
24
- node : ["10.x", "12.x", "14.x" ]
25
- os : [" ubuntu-latest" ]
23
+ node-version : ['16.x' ]
24
+ os : [' ubuntu-latest' ]
26
25
27
26
steps :
28
- - uses : actions/checkout@v2.3.4
27
+ - uses : actions/checkout@v3
29
28
- name : Use Node.js ${{ matrix.node-version }}
30
- uses : actions/setup-node@v2.1.4
29
+ uses : actions/setup-node@v2
31
30
with :
32
31
node-version : ${{ matrix.node-version }}
33
32
33
+ - name : Get yarn cache directory path
34
+ id : yarn-cache-dir-path
35
+ run : echo "::set-output name=dir::$(yarn cache dir)"
34
36
35
- - name : Get npm cache directory
36
- id : npm-cache-dir
37
- run : |
38
- echo "::set-output name=dir::$(npm config get cache)"
39
- - uses : actions/cache@v2
40
- id : npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
37
+ - uses : actions/cache@v3
38
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
41
39
with :
42
- path : ${{ steps.npm -cache-dir.outputs.dir }}
43
- key : ${{ runner.os }}-node -${{ hashFiles('**/package-lock.json ') }}
40
+ path : ${{ steps.yarn -cache-dir-path .outputs.dir }}
41
+ key : ${{ runner.os }}-yarn -${{ hashFiles('**/yarn.lock ') }}
44
42
restore-keys : |
45
- ${{ runner.os }}-node-
46
-
47
-
48
- - name : npm install, build, and test
49
- run : |
50
- npm install
51
- npm run ci
52
- env :
53
- CI : true
43
+ ${{ runner.os }}-yarn-
44
+ - name : Install project dependencies
45
+ run : yarn --prefer-offline
46
+ id : install
47
+
48
+ - name : Install project dependencies
49
+ run : yarn run build
50
+ id : production
0 commit comments