@@ -3,33 +3,106 @@ name: Node CI
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- test :
6
+ matrix :
7
+ runs-on : ubuntu-latest
8
+ outputs :
9
+ latest : ${{ steps.set-matrix.outputs.requireds }}
10
+ nonlatest : ${{ steps.set-matrix.outputs.optionals }}
11
+ steps :
12
+ - uses : ljharb/actions/node/matrix@main
13
+ id : set-matrix
14
+ with :
15
+ versionsAsRoot : true
16
+ type : majors
17
+ preset : " >= 0.8"
18
+
19
+ latest :
20
+ needs : [matrix]
21
+ name : ' latest majors'
7
22
strategy :
23
+ fail-fast : false
8
24
matrix :
9
- os : [ubuntu-latest, windows-latest, macos-latest]
10
- node-version : ['0.8', '0.10', '0.12', '4.x', '6.x', '8.x', '10.x', '12.x']
25
+ os : [windows-latest, macos-latest]
26
+ node-version : ${{ fromJson(needs.matrix.outputs.latest) }}
11
27
exclude :
28
+ - os : windows-latest
29
+ node-version : ' 3'
30
+ - os : windows-latest
31
+ node-version : ' 2'
32
+ - os : windows-latest
33
+ node-version : ' 1'
12
34
- os : windows-latest
13
35
node-version : ' 0.8'
14
36
15
37
runs-on : ${{matrix.os}}
16
38
17
39
steps :
18
- - uses : actions/checkout@v1
40
+ - uses : actions/checkout@v3
41
+
42
+ - uses : ljharb/actions/node/install@main
43
+ name : ' nvm install ${{ matrix.node-version }} && npm install'
44
+ with :
45
+ node-version : ${{ matrix.node-version }}
46
+ skip-ls-check : true
47
+ if : matrix.os != 'windows-latest'
48
+
19
49
- name : Use Node.js ${{ matrix.node-version }}
20
- uses : actions/setup-node@v1
50
+ uses : actions/setup-node@v3
21
51
with :
22
52
node-version : ${{ matrix.node-version }}
23
- - name : Disable strict SSL checks
24
- uses : allenevans/set-env@v1.0.0
53
+ if : matrix.os == 'windows-latest'
54
+
55
+ - run : npm install
56
+ env :
57
+ NPM_CONFIG_STRICT_SSL : false
58
+ if : matrix.os == 'windows-latest'
59
+
60
+ - run : npm run tests-only
61
+ - uses : codecov/codecov-action@v3
62
+
63
+ nonlatest :
64
+ needs : [matrix, latest]
65
+ name : ' non-latest majors'
66
+ continue-on-error : true
67
+ if : ${{ needs.matrix.outputs.nonlatest != '[]' && (!github.head_ref || !startsWith(github.head_ref, 'renovate')) }}
68
+ strategy :
69
+ fail-fast : false
70
+ matrix :
71
+ os : [windows-latest, macos-latest]
72
+ node-version : ${{ fromJson(needs.matrix.outputs.nonlatest) }}
73
+ exclude :
74
+ - os : windows-latest
75
+ node-version : ' 0.8'
76
+
77
+ runs-on : ${{matrix.os}}
78
+
79
+ steps :
80
+ - uses : actions/checkout@v3
81
+
82
+ - uses : ljharb/actions/node/install@main
83
+ name : ' nvm install ${{ matrix.node-version }} && npm install'
25
84
with :
26
- NPM_CONFIG_STRICT_SSL : ' false'
27
- if : matrix.node-version == '0.8'
28
- - name : Upgrade npm to latest available version
29
- run : |
30
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
31
- source $HOME/.nvm/nvm.sh
32
- nvm install-latest-npm
85
+ node-version : ${{ matrix.node-version }}
86
+ skip-ls-check : true
33
87
if : matrix.os != 'windows-latest'
88
+
89
+ - name : Use Node.js ${{ matrix.node-version }}
90
+ uses : actions/setup-node@v3
91
+ with :
92
+ node-version : ${{ matrix.node-version }}
93
+ if : matrix.os == 'windows-latest'
94
+
34
95
- run : npm install
35
- - run : npm test
96
+ env :
97
+ NPM_CONFIG_STRICT_SSL : false
98
+ if : matrix.os == 'windows-latest'
99
+
100
+ - run : npm run tests-only
101
+ - uses : codecov/codecov-action@v3
102
+
103
+ node :
104
+ name : ' node majors, windows/mac'
105
+ needs : [latest, nonlatest]
106
+ runs-on : ubuntu-latest
107
+ steps :
108
+ - run : ' echo tests completed'
0 commit comments