@@ -20,187 +20,149 @@ concurrency:
20
20
cancel-in-progress : true
21
21
22
22
jobs :
23
- test :
23
+ lint :
24
+ name : Lint
24
25
runs-on : ubuntu-latest
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+ - name : Setup Node.js {{ matrix.node-version }}
29
+ uses : actions/setup-node@v4
30
+ with :
31
+ node-version : ' lts/*'
32
+ persist-credentials : false
33
+
34
+ - name : Install dependencies
35
+ run : npm install --ignore-scripts --only=dev
36
+
37
+ - name : Run lint
38
+ run : npm run lint
39
+
40
+ test :
41
+ name : Run tests
25
42
strategy :
26
43
fail-fast : false
27
44
matrix :
28
- name :
29
- - Node.js 0.10
30
- - Node.js 0.12
31
- - io.js 1.x
32
- - io.js 2.x
33
- - io.js 3.x
34
- - Node.js 4.x
35
- - Node.js 5.x
36
- - Node.js 6.x
37
- - Node.js 7.x
38
- - Node.js 8.x
39
- - Node.js 9.x
40
- - Node.js 10.x
41
- - Node.js 11.x
42
- - Node.js 12.x
43
- - Node.js 13.x
44
- - Node.js 14.x
45
- - Node.js 15.x
46
- - Node.js 16.x
47
- - Node.js 17.x
48
- - Node.js 18.x
49
- - Node.js 19.x
50
- - Node.js 20.x
51
- - Node.js 21.x
52
- - Node.js 22.x
53
-
45
+ os : [ubuntu-latest, windows-latest]
46
+ node-version :
47
+ - " 0.10"
48
+ - " 0.12"
49
+ - " 4"
50
+ - " 5"
51
+ - " 6"
52
+ - " 7"
53
+ - " 8"
54
+ - " 9"
55
+ - " 10"
56
+ - " 11"
57
+ - " 12"
58
+ - " 13"
59
+ - " 14"
60
+ - " 15"
61
+ - " 16"
62
+ - " 17"
63
+ - " 18"
64
+ - " 19"
65
+ - " 20"
66
+ - " 21"
67
+ - " 22"
68
+ # Use supported versions of our testing tools under older versions of Node
69
+ # Install npm in some specific cases where we need to
54
70
include :
55
- - name : Node.js 0.10
56
- node-version : " 0.10"
57
-
58
-
59
- - name : Node.js 0.12
60
- node-version : " 0.12"
61
-
62
-
63
- - name : io.js 1.x
64
- node-version : " 1"
65
-
66
-
67
- - name : io.js 2.x
68
- node-version : " 2"
69
-
70
-
71
- - name : io.js 3.x
72
- node-version : " 3"
73
-
74
-
75
- - name : Node.js 4.x
76
- node-version : " 4"
77
-
78
-
79
- - name : Node.js 5.x
80
- node-version : " 5"
81
-
82
-
83
- - name : Node.js 6.x
84
- node-version : " 6"
85
-
86
-
87
- - name : Node.js 7.x
88
- node-version : " 7"
89
-
90
-
91
- - name : Node.js 8.x
92
- node-version : " 8"
93
-
71
+ - node-version : " 0.10"
72
+
73
+ # Npm isn't being installed on windows w/ setup-node for
74
+ # 0.10 and 0.12, which will end up choking when npm uses es6
75
+
94
76
95
- - name : Node.js 9.x
96
- node-version : " 9 "
97
-
77
+ - node-version : " 0.12 "
78
+
79
+
98
80
99
- - name : Node.js 10.x
100
- node-version : " 10"
101
-
81
+ - node-version : " 4"
82
+
102
83
103
- - name : Node.js 11.x
104
- node-version : " 11"
105
-
84
+ - node-version : " 5"
85
+
86
+ # fixes https://github.com/npm/cli/issues/681
87
+
106
88
107
- - name : Node.js 12.x
108
- node-version : " 12"
109
-
89
+ - node-version : " 6"
90
+
110
91
111
- - name : Node.js 13.x
112
- node-version : " 13"
113
-
92
+ - node-version : " 7"
93
+
114
94
115
- - name : Node.js 14.x
116
- node-version : " 14 "
95
+ - node-version : " 8 "
96
+
117
97
118
- - name : Node.js 15.x
119
- node-version : " 15 "
98
+ - node-version : " 9 "
99
+
120
100
121
- - name : Node.js 16.x
122
- node-version : " 16 "
101
+ - node-version : " 10 "
102
+
123
103
124
- - name : Node.js 17.x
125
- node-version : " 17 "
104
+ - node-version : " 11 "
105
+
126
106
127
- - name : Node.js 18.x
128
- node-version : " 18 "
107
+ - node-version : " 12 "
108
+
129
109
130
- - name : Node.js 19.x
131
- node-version : " 19"
132
-
133
- - name : Node.js 20.x
134
- node-version : " 20"
135
-
136
- - name : Node.js 21.x
137
- node-version : " 21"
138
-
139
- - name : Node.js 22.x
140
- node-version : " 22"
110
+ - node-version : " 13"
111
+
141
112
113
+ runs-on : ${{ matrix.os }}
142
114
steps :
143
- - uses : actions/checkout@v4
144
-
145
- - name : Install Node.js ${{ matrix.node-version }}
146
- shell : bash -eo pipefail -l {0}
147
- run : |
148
- nvm install --default ${{ matrix.node-version }}
149
- dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
150
-
151
- - name : Install npm module(s) ${{ matrix.npm-i }}
152
- run : npm install --save-dev ${{ matrix.npm-i }}
153
- if : matrix.npm-i != ''
154
-
155
- - name : Remove non-test dependencies
156
- run : npm rm --silent --save-dev connect-redis
157
-
158
- - name : Setup Node.js version-specific dependencies
159
- shell : bash
160
- run : |
161
- # eslint for linting
162
- # - remove on Node.js < 12
163
- if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then
164
- node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
165
- grep -E '^eslint(-|$)' | \
166
- sort -r | \
167
- xargs -n1 npm rm --silent --save-dev
168
- fi
169
-
170
- - name : Install Node.js dependencies
171
- run : npm install
172
-
173
- - name : List environment
174
- id : list_env
175
- shell : bash
176
- run : |
177
- echo "node@$(node -v)"
178
- echo "npm@$(npm -v)"
179
- npm -s ls ||:
180
- (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT"
181
-
182
- - name : Run tests
183
- shell : bash
184
- run : |
185
- npm run test-ci
186
- cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
187
-
188
- - name : Lint code
189
- if : steps.list_env.outputs.eslint != ''
190
- run : npm run lint
191
-
192
- - name : Collect code coverage
193
- run : |
194
- mv ./coverage "./${{ matrix.name }}"
195
- mkdir ./coverage
196
- mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
197
-
198
- - name : Upload code coverage
199
- uses : actions/upload-artifact@v3
200
- with :
201
- name : coverage
202
- path : ./coverage
203
- retention-days : 1
115
+ - uses : actions/checkout@v4
116
+ with :
117
+ persist-credentials : false
118
+
119
+ - name : Setup Node.js ${{ matrix.node-version }}
120
+ uses : actions/setup-node@v4
121
+ with :
122
+ node-version : ${{ matrix.node-version }}
123
+
124
+ - name : Npm version fixes
125
+ if : ${{matrix.npm-version != ''}}
126
+ run : npm install -g ${{ matrix.npm-version }}
127
+
128
+ - name : Configure npm loglevel
129
+ run : |
130
+ npm config set loglevel error
131
+ shell : bash
132
+
133
+ - name : Install dependencies
134
+ run : npm install
135
+
136
+ - name : Install Node version specific dev deps
137
+ if : ${{ matrix.npm-i != '' }}
138
+ run : npm install --save-dev ${{ matrix.npm-i }}
139
+
140
+ - name : Remove non-test dependencies
141
+ run : npm rm --silent --save-dev connect-redis
142
+
143
+ - name : Output Node and NPM versions
144
+ run : |
145
+ echo "Node.js version: $(node -v)"
146
+ echo "NPM version: $(npm -v)"
147
+
148
+ - name : Run tests
149
+ shell : bash
150
+ run : |
151
+ npm run test-ci
152
+ cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
153
+
154
+ - name : Collect code coverage
155
+ run : |
156
+ mv ./coverage "./${{ matrix.node-version }}"
157
+ mkdir ./coverage
158
+ mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
159
+
160
+ - name : Upload code coverage
161
+ uses : actions/upload-artifact@v3
162
+ with :
163
+ name : coverage
164
+ path : ./coverage
165
+ retention-days : 1
204
166
205
167
coverage :
206
168
needs : test
0 commit comments