3
3
name : CI
4
4
5
5
on :
6
+ workflow_dispatch :
6
7
pull_request :
8
+ branches :
9
+ - ' *'
7
10
push :
8
11
branches :
9
12
- main
@@ -16,46 +19,67 @@ jobs:
16
19
lint :
17
20
runs-on : ubuntu-latest
18
21
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
21
28
with :
22
- node-version : ' 16'
23
- - run : npm i --prefer-online -g npm@latest
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
24
33
- run : npm i
25
34
- run : npm run lint
26
35
27
36
test :
28
37
strategy :
29
38
fail-fast : false
30
39
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
32
47
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
39
54
runs-on : ${{ matrix.platform.os }}
40
55
defaults :
41
56
run :
42
57
shell : ${{ matrix.platform.shell }}
43
58
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 "[email protected] "
63
+ git config --global user.name "npm cli ops bot"
64
+ - uses : actions/setup-node@v3
46
65
with :
47
66
node-version : ${{ matrix.node-version }}
48
- # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
49
67
- 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.'))
51
70
run : |
52
71
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
53
72
tar xf npm-7.5.4.tgz
54
73
cd package
55
74
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
56
75
cd ..
57
76
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.') }}
59
83
run : npm i --prefer-online --no-fund --no-audit -g npm@latest
60
84
- run : npm -v
61
85
- run : npm i
0 commit comments