Skip to content

Commit 63992bb

Browse files
committed
Merge branch 'ci/v5-node-lts' into 5-merge
2 parents ea49706 + 9c756b0 commit 63992bb

File tree

3 files changed

+147
-169
lines changed

3 files changed

+147
-169
lines changed

.github/workflows/ci.yml

+5-62
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- develop
88
- '4.x'
99
- '5.x'
10+
- '5.0'
1011
paths-ignore:
1112
- '*.md'
1213
pull_request:
@@ -38,65 +39,14 @@ jobs:
3839
run: npm run lint
3940

4041
test:
41-
name: Run tests
4242
strategy:
4343
fail-fast: false
4444
matrix:
4545
os: [ubuntu-latest, windows-latest]
46-
node-version:
47-
- "4"
48-
- "5"
49-
- "6"
50-
- "7"
51-
- "8"
52-
- "9"
53-
- "10"
54-
- "11"
55-
- "12"
56-
- "13"
57-
- "14"
58-
- "15"
59-
- "16"
60-
- "17"
61-
- "18"
62-
- "19"
63-
- "20"
64-
- "21"
65-
- "22"
66-
# Use supported versions of our testing tools under older versions of Node
67-
# Install npm in some specific cases where we need to
68-
include:
69-
- node-version: "4"
70-
71-
72-
- node-version: "5"
73-
74-
# fixes https://github.com/npm/cli/issues/681
75-
npm-version: "[email protected]"
76-
77-
- node-version: "6"
78-
79-
80-
- node-version: "7"
81-
82-
83-
- node-version: "8"
84-
85-
86-
- node-version: "9"
87-
88-
89-
- node-version: "10"
90-
91-
92-
- node-version: "11"
93-
94-
95-
- node-version: "12"
96-
97-
98-
- node-version: "13"
99-
46+
node-version: [18, 19, 20, 21, 22]
47+
# Node.js release schedule: https://nodejs.org/en/about/releases/
48+
49+
name: Node.js ${{ matrix.node-version }}
10050

10151
runs-on: ${{ matrix.os }}
10252
steps:
@@ -121,13 +71,6 @@ jobs:
12171
- name: Install dependencies
12272
run: npm install
12373

124-
- name: Install Node version specific dev deps
125-
if: ${{ matrix.npm-i != '' }}
126-
run: npm install --save-dev ${{ matrix.npm-i }}
127-
128-
- name: Remove non-test dependencies
129-
run: npm rm --silent --save-dev connect-redis
130-
13174
- name: Output Node and NPM versions
13275
run: |
13376
echo "Node.js version: $(node -v)"

.github/workflows/legacy.yml

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: legacy
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
name:
14+
- Node.js 11.x
15+
- Node.js 12.x
16+
- Node.js 13.x
17+
- Node.js 14.x
18+
- Node.js 15.x
19+
- Node.js 16.x
20+
- Node.js 17.x
21+
22+
include:
23+
- name: Node.js 11.x
24+
node-version: "11.15"
25+
26+
27+
- name: Node.js 12.x
28+
node-version: "12.22"
29+
30+
31+
- name: Node.js 13.x
32+
node-version: "13.14"
33+
34+
35+
- name: Node.js 14.x
36+
node-version: "14.20"
37+
38+
- name: Node.js 15.x
39+
node-version: "15.14"
40+
41+
- name: Node.js 16.x
42+
node-version: "16.20"
43+
44+
- name: Node.js 17.x
45+
node-version: "17.9"
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Install Node.js ${{ matrix.node-version }}
51+
shell: bash -eo pipefail -l {0}
52+
run: |
53+
nvm install --default ${{ matrix.node-version }}
54+
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
55+
56+
- name: Configure npm
57+
run: |
58+
npm config set loglevel error
59+
if [[ "$(npm config get package-lock)" == "true" ]]; then
60+
npm config set package-lock false
61+
else
62+
npm config set shrinkwrap false
63+
fi
64+
65+
- name: Install npm module(s) ${{ matrix.npm-i }}
66+
run: npm install --save-dev ${{ matrix.npm-i }}
67+
if: matrix.npm-i != ''
68+
69+
- name: Remove non-test dependencies
70+
run: npm rm --silent --save-dev connect-redis
71+
72+
- name: Setup Node.js version-specific dependencies
73+
shell: bash
74+
run: |
75+
# eslint for linting
76+
# - remove on Node.js < 12
77+
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then
78+
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
79+
grep -E '^eslint(-|$)' | \
80+
sort -r | \
81+
xargs -n1 npm rm --silent --save-dev
82+
fi
83+
84+
- name: Install Node.js dependencies
85+
run: npm install
86+
87+
- name: List environment
88+
id: list_env
89+
shell: bash
90+
run: |
91+
echo "node@$(node -v)"
92+
echo "npm@$(npm -v)"
93+
npm -s ls ||:
94+
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT"
95+
96+
- name: Run tests
97+
shell: bash
98+
run: |
99+
npm run test-ci
100+
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
101+
102+
- name: Lint code
103+
if: steps.list_env.outputs.eslint != ''
104+
run: npm run lint
105+
106+
- name: Collect code coverage
107+
run: |
108+
mv ./coverage "./${{ matrix.name }}"
109+
mkdir ./coverage
110+
mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
111+
112+
- name: Upload code coverage
113+
uses: actions/upload-artifact@v3
114+
with:
115+
name: coverage
116+
path: ./coverage
117+
retention-days: 1
118+
119+
coverage:
120+
needs: test
121+
runs-on: ubuntu-latest
122+
steps:
123+
- uses: actions/checkout@v4
124+
125+
- name: Install lcov
126+
shell: bash
127+
run: sudo apt-get -y install lcov
128+
129+
- name: Collect coverage reports
130+
uses: actions/download-artifact@v3
131+
with:
132+
name: coverage
133+
path: ./coverage
134+
135+
- name: Merge coverage reports
136+
shell: bash
137+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
138+
139+
- name: Upload coverage report
140+
uses: coverallsapp/github-action@master
141+
with:
142+
github-token: ${{ secrets.GITHUB_TOKEN }}

appveyor.yml

-107
This file was deleted.

0 commit comments

Comments
 (0)