33name : CI
44
55on :
6+ workflow_dispatch :
67 pull_request :
8+ branches :
9+ - ' *'
710 push :
811 branches :
912 - main
@@ -16,47 +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 "ops+npm-cli@npmjs.com"
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
24- - run : npm i
29+ node-version : 16.x
30+ - name : Update npm to latest
31+ run : npm i --prefer-online --no-fund --no-audit -g npm@latest
32+ - run : npm -v
33+ - run : npm i --ignore-scripts
2534 - run : npm run lint
2635
2736 test :
2837 strategy :
2938 fail-fast : false
3039 matrix :
31- node-version : [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
40+ node-version :
41+ - 12.13.0
42+ - 12.x
43+ - 14.15.0
44+ - 14.x
45+ - 16.0.0
46+ - 16.x
3247 platform :
33- - os : ubuntu-latest
34- shell : bash
35- - os : macos-latest
36- shell : bash
37- - os : windows-latest
38- shell : cmd
48+ - os : ubuntu-latest
49+ shell : bash
50+ - os : macos-latest
51+ shell : bash
52+ - os : windows-latest
53+ shell : cmd
3954 runs-on : ${{ matrix.platform.os }}
4055 defaults :
4156 run :
4257 shell : ${{ matrix.platform.shell }}
4358 steps :
44- - uses : actions/checkout@v2
45- - uses : actions/setup-node@v2
59+ - uses : actions/checkout@v3
60+ - name : Setup git user
61+ run : |
62+ git config --global user.email "ops+npm-cli@npmjs.com"
63+ git config --global user.name "npm cli ops bot"
64+ - uses : actions/setup-node@v3
4665 with :
4766 node-version : ${{ matrix.node-version }}
48- # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
4967 - name : Update to workable npm (windows)
50- if : matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
68+ # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
69+ if : matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
5170 run : |
5271 curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
5372 tar xf npm-7.5.4.tgz
5473 cd package
5574 node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
5675 cd ..
5776 rmdir /s /q package
58- - name : Update npm
77+ - name : Update npm to 7
78+ # If we do test on npm 10 it needs npm7
79+ if : startsWith(matrix.node-version, '10.')
80+ run : npm i --prefer-online --no-fund --no-audit -g npm@7
81+ - name : Update npm to latest
82+ if : ${{ !startsWith(matrix.node-version, '10.') }}
5983 run : npm i --prefer-online --no-fund --no-audit -g npm@latest
6084 - run : npm -v
61- - run : npm i
85+ - run : npm i --ignore-scripts
6286 - run : npm test --ignore-scripts
0 commit comments