33name : CI
44
55on :
6+ workflow_dispatch : null
67 pull_request :
8+ branches :
9+ - ' *'
710 push :
811 branches :
912 - main
@@ -16,37 +19,68 @@ jobs:
1619 lint :
1720 runs-on : ubuntu-latest
1821 steps :
19- - uses : actions/checkout@v2
20- - uses : actions/setup-node@v2
22+ - uses : actions/checkout@v3
23+ - name : Setup git user
24+ run : |
25+ git config --global user.email "[email protected] " 26+ git config --global user.name "npm cli ops bot"
27+ - uses : actions/setup-node@v3
2128 with :
22- node-version : ' 16'
23- - run : npm i --prefer-online -g npm@latest
29+ node-version : 16.x
30+ - name : Update to workable npm (windows)
31+ # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
32+ if : matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
33+ run : |
34+ curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
35+ tar xf npm-7.5.4.tgz
36+ cd package
37+ node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
38+ cd ..
39+ rmdir /s /q package
40+ - name : Update npm to 7
41+ # If we do test on npm 10 it needs npm7
42+ if : matrix.node-version <= 10
43+ run : npm i --prefer-online --no-fund --no-audit -g npm@7
44+ - name : Update npm to latest
45+ if : matrix.node-version > 10
46+ run : npm i --prefer-online --no-fund --no-audit -g npm@latest
47+ - run : npm -v
2448 - run : npm i
2549 - run : npm run lint
2650
2751 test :
2852 strategy :
2953 fail-fast : false
3054 matrix :
31- node-version : [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
55+ node-version :
56+ - 12.13.0
57+ - 12.x
58+ - 14.15.0
59+ - 14.x
60+ - 16.0.0
61+ - 16.x
3262 platform :
33- - os : ubuntu-latest
34- shell : bash
35- - os : macos-latest
36- shell : bash
37- - os : windows-latest
38- shell : cmd
63+ - os : ubuntu-latest
64+ shell : bash
65+ - os : macos-latest
66+ shell : bash
67+ - os : windows-latest
68+ shell : cmd
3969 runs-on : ${{ matrix.platform.os }}
4070 defaults :
4171 run :
4272 shell : ${{ matrix.platform.shell }}
4373 steps :
44- - uses : actions/checkout@v2
45- - uses : actions/setup-node@v2
74+ - uses : actions/checkout@v3
75+ - name : Setup git user
76+ run : |
77+ git config --global user.email "[email protected] " 78+ git config --global user.name "npm cli ops bot"
79+ - uses : actions/setup-node@v3
4680 with :
47- node-version : ${{ matrix.node-version }}
48- # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
81+ node-version : 16.x
4982 - name : Update to workable npm (windows)
83+ # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
5084 if : matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
5185 run : |
5286 curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
5589 node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
5690 cd ..
5791 rmdir /s /q package
58- - name : Update npm
92+ - name : Update npm to 7
93+ # If we do test on npm 10 it needs npm7
94+ if : matrix.node-version <= 10
95+ run : npm i --prefer-online --no-fund --no-audit -g npm@7
96+ - name : Update npm to latest
97+ if : matrix.node-version > 10
5998 run : npm i --prefer-online --no-fund --no-audit -g npm@latest
6099 - run : npm -v
61100 - run : npm i
0 commit comments