1111 - ' **'
1212
1313env :
14- PRIMARY_NODE_VERSION : 16 .x
14+ PRIMARY_NODE_VERSION : 18 .x
1515 PRIMARY_OS : ubuntu-latest
1616 REGISTRY : https://registry.npmjs.org/
1717
2222 strategy :
2323 matrix :
2424 os : [ubuntu-latest, macos-latest, windows-latest]
25- node-version : [6.x, 8.x, 10.x, 12.x, 14.x, 16.x]
25+ node-version : [6.x, 8.x, 10.x, 12.x, 14.x, 16.x, 18.x ]
2626
2727 steps :
2828
@@ -44,23 +44,24 @@ jobs:
4444 uses : actions/setup-node@v2
4545 with :
4646 node-version : ${{ matrix.node-version }}
47- - name : Get npm cache directory
48- id : npm-cache-dir
47+
48+ - name : Get yarn cache directory
49+ id : yarn-cache-dir
4950 run : |
50- echo "::set-output name=dir::$(npm config get cache)"
51+ echo "::set-output name=dir::$(yarn cache dir )"
5152
5253 - uses : actions/cache@v2
53- id : npm -cache
54+ id : yarn -cache
5455 with :
55- path : ${{ steps.npm -cache-dir.outputs.dir }}
56- 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') }}
5758 restore-keys : |
58- ${{ matrix.os }}-${{ matrix.node-version }}-node
59+ ${{ matrix.os }}-${{ matrix.node-version }}-yarn-
5960
6061 - name : Install dependencies and build
6162 run : |
62- npm install
63- npm run build
63+ yarn install --frozen-lockfile
64+ yarn build
6465
6566 - name : Snyk security check
6667 if : matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
@@ -74,11 +75,11 @@ jobs:
7475 env :
7576 CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
7677 with :
77- coverageCommand : npm run cover
78+ coverageCommand : yarn cover
7879
7980 - name : Run unit tests
8081 if : " !(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
81- run : npm run test
82+ run : yarn test
8283
8384 publish_version :
8485 name : Publish
@@ -104,23 +105,23 @@ jobs:
104105 node-version : ${{ matrix.node-version }}
105106 registry-url : ${{ env.REGISTRY }}
106107
107- - name : Get npm cache directory
108- id : npm -cache-dir
108+ - name : Get yarn cache directory
109+ id : yarn -cache-dir
109110 run : |
110- echo "::set-output name=dir::$(npm config get cache)"
111+ echo "::set-output name=dir::$(yarn cache dir )"
111112
112113 - uses : actions/cache@v2
113- id : npm -cache
114+ id : yarn -cache
114115 with :
115- path : ${{ steps.npm -cache-dir.outputs.dir }}
116- 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') }}
117118 restore-keys : |
118- ${{ matrix.os }}-${{ matrix.node-version }}-node
119+ ${{ matrix.os }}-${{ matrix.node-version }}-yarn-
119120
120121 - name : Install dependencies and build
121122 run : |
122- npm install
123- npm run build
123+ yarn install --frozen-lockfile
124+ yarn build
124125
125126 - name : Publish
126127 uses : JS-DevTools/npm-publish@v1
0 commit comments