22
22
strategy :
23
23
matrix :
24
24
os : [ ubuntu-latest ]
25
- node-version : [ 6.x, 8.x, 10.x, 12.x, 14.x, 16.x, 17 .x ]
25
+ node-version : [ 6.x, 8.x, 10.x, 12.x, 14.x, 16.x, 18 .x ]
26
26
27
27
steps :
28
28
@@ -45,23 +45,23 @@ jobs:
45
45
with :
46
46
node-version : ${{ matrix.node-version }}
47
47
48
- - name : Get npm cache directory
49
- id : npm -cache-dir
48
+ - name : Get yarn cache directory
49
+ id : yarn -cache-dir
50
50
run : |
51
- echo "::set-output name=dir::$(npm config get cache)"
51
+ echo "::set-output name=dir::$(yarn cache dir )"
52
52
53
53
- uses : actions/cache@v2
54
- id : npm -cache
54
+ id : yarn -cache
55
55
with :
56
- path : ${{ steps.npm -cache-dir.outputs.dir }}
57
- key : ${{ matrix.os }}-${{ matrix.node-version }}-node
56
+ path : ${{ steps.yarn -cache-dir.outputs.dir }}
57
+ key : ${{ matrix.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
58
58
restore-keys : |
59
- ${{ matrix.os }}-${{ matrix.node-version }}-node
59
+ ${{ matrix.os }}-${{ matrix.node-version }}-yarn-
60
60
61
61
- name : Install dependencies and build
62
62
run : |
63
- npm install
64
- npm run build
63
+ yarn install --frozen-lockfile
64
+ yarn build
65
65
66
66
- name : Snyk security check
67
67
if : matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
@@ -75,11 +75,11 @@ jobs:
75
75
env :
76
76
CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
77
77
with :
78
- coverageCommand : npm run cover
78
+ coverageCommand : yarn cover
79
79
80
80
- name : Run unit tests
81
81
if : " !(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
82
- run : npm run mocha
82
+ run : yarn mocha
83
83
84
84
publish_version :
85
85
name : Publish
@@ -105,23 +105,23 @@ jobs:
105
105
node-version : ${{ matrix.node-version }}
106
106
registry-url : ${{ env.REGISTRY }}
107
107
108
- - name : Get npm cache directory
109
- id : npm -cache-dir
108
+ - name : Get yarn cache directory
109
+ id : yarn -cache-dir
110
110
run : |
111
- echo "::set-output name=dir::$(npm config get cache)"
111
+ echo "::set-output name=dir::$(yarn cache dir )"
112
112
113
113
- uses : actions/cache@v2
114
- id : npm -cache
114
+ id : yarn -cache
115
115
with :
116
- path : ${{ steps.npm -cache-dir.outputs.dir }}
117
- key : ${{ matrix.os }}-${{ matrix.node-version }}-node
116
+ path : ${{ steps.yarn -cache-dir.outputs.dir }}
117
+ key : ${{ matrix.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
118
118
restore-keys : |
119
- ${{ matrix.os }}-${{ matrix.node-version }}-node
119
+ ${{ matrix.os }}-${{ matrix.node-version }}-yarn-
120
120
121
121
- name : Install dependencies and build
122
122
run : |
123
- npm install
124
- npm run build
123
+ yarn install --frozen-lockfile
124
+ yarn build
125
125
126
126
- name : Publish
127
127
uses : JS-DevTools/npm-publish@v1
0 commit comments