Skip to content

Commit 63f4e26

Browse files
authored
chore: update Node.js version in CI and pin dependencies (#32)
* PR: #32 * Ref: Same fix as jshttp/http-errors#109 * Fix pin versions nyc version for testing on node 8 & 9 * fix npm config on ci * add node 16 & 17 to ci tests and update node versions * add missing node versions to ci
1 parent 454ceb6 commit 63f4e26

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-20.04
1010
strategy:
1111
matrix:
1212
name:
@@ -28,6 +28,12 @@ jobs:
2828
- Node.js 13.x
2929
- Node.js 14.x
3030
- Node.js 15.x
31+
- Node.js 16.x
32+
- Node.js 17.x
33+
- Node.js 18.x
34+
- Node.js 19.x
35+
- Node.js 20.x
36+
- Node.js 21.x
3137

3238
include:
3339
- name: Node.js 0.8
@@ -73,32 +79,49 @@ jobs:
7379

7480
- name: Node.js 8.x
7581
node-version: "8.17"
76-
npm-i: mocha@7.2.0
82+
npm-i: mocha@7.2.0 nyc@14.1.1
7783

7884
- name: Node.js 9.x
7985
node-version: "9.11"
80-
npm-i: mocha@7.2.0
86+
npm-i: mocha@7.2.0 nyc@14.1.1
8187

8288
- name: Node.js 10.x
83-
node-version: "10.23"
89+
node-version: "10.24"
90+
npm-i: mocha@8.4.0
8491

8592
- name: Node.js 11.x
8693
node-version: "11.15"
94+
npm-i: mocha@8.4.0
8795

8896
- name: Node.js 12.x
89-
node-version: "12.20"
97+
node-version: "12.22"
9098

9199
- name: Node.js 13.x
92100
node-version: "13.14"
93101

94102
- name: Node.js 14.x
95-
node-version: "14.15"
103+
node-version: "14.18"
96104

97105
- name: Node.js 15.x
98-
node-version: "15.5"
106+
node-version: "15.14"
99107

100108
- name: Node.js 16.x
101-
node-version: "16.2"
109+
node-version: "16.13"
110+
111+
- name: Node.js 17.x
112+
node-version: "17.2"
113+
114+
- name: Node.js 18.x
115+
node-version: "18.20"
116+
117+
- name: Node.js 19.x
118+
node-version: "19.9"
119+
120+
- name: Node.js 20.x
121+
node-version: "20.12"
122+
123+
- name: Node.js 21.x
124+
node-version: "21.7"
102125

103126
steps:
104127
- uses: actions/checkout@v2
@@ -107,13 +130,21 @@ jobs:
107130
shell: bash -eo pipefail -l {0}
108131
run: |
109132
nvm install --default ${{ matrix.node-version }}
110-
if [[ "${{ matrix.node-version }}" == 0.* ]]; then
133+
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
134+
nvm install --alias=npm 0.10
135+
nvm use ${{ matrix.node-version }}
136+
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
111137
npm config set strict-ssl false
112138
fi
113139
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
114140
115141
- name: Configure npm
116-
run: npm config set shrinkwrap false
142+
run: |
143+
if [[ "$(npm config get package-lock)" == "true" ]]; then
144+
npm config set package-lock false
145+
else
146+
npm config set shrinkwrap false
147+
fi
117148
118149
- name: Remove non-test npm modules
119150
run: npm rm --silent --save-dev csv-parse raw-body stream-to-array
@@ -180,3 +211,4 @@ jobs:
180211
with:
181212
github-token: ${{ secrets.github_token }}
182213
parallel-finished: true
214+

0 commit comments

Comments
 (0)