@@ -3,33 +3,106 @@ name: Node CI
33on : [push, pull_request]
44
55jobs :
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'
722 strategy :
23+ fail-fast : false
824 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) }}
1127 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'
1234 - os : windows-latest
1335 node-version : ' 0.8'
1436
1537 runs-on : ${{matrix.os}}
1638
1739 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+
1949 - name : Use Node.js ${{ matrix.node-version }}
20- uses : actions/setup-node@v1
50+ uses : actions/setup-node@v3
2151 with :
2252 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'
2584 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
3387 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+
3495 - 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