Skip to content

Commit 3e5ac75

Browse files
authored
ci: merge coverage via artifacts, disable fail-fast, add Node.js 23-26 (#69)
1 parent 4b9db81 commit 3e5ac75

1 file changed

Lines changed: 73 additions & 39 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 73 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ permissions:
99

1010
jobs:
1111
test:
12-
permissions:
13-
checks: write # for coverallsapp/github-action to create new checks
14-
contents: read # for actions/checkout to fetch code
1512
runs-on: ubuntu-latest
1613
strategy:
14+
fail-fast: false
1715
matrix:
1816
name:
1917
- Node.js 0.10
@@ -40,6 +38,10 @@ jobs:
4038
- Node.js 20.x
4139
- Node.js 21.x
4240
- Node.js 22.x
41+
- Node.js 23.x
42+
- Node.js 24.x
43+
- Node.js 25.x
44+
- Node.js 26.x
4345

4446
include:
4547
- name: Node.js 0.10
@@ -53,104 +55,120 @@ jobs:
5355
npm-rm: beautify-benchmark benchmark
5456

5557
- name: io.js 1.x
56-
node-version: "1.8"
58+
node-version: "1"
5759
npm-i: mocha@3.5.3 nyc@10.3.2
5860
npm-rm: beautify-benchmark benchmark
5961

6062
- name: io.js 2.x
61-
node-version: "2.5"
63+
node-version: "2"
6264
npm-i: mocha@3.5.3 nyc@10.3.2
6365
npm-rm: beautify-benchmark benchmark
6466

6567
- name: io.js 3.x
66-
node-version: "3.3"
68+
node-version: "3"
6769
npm-i: mocha@3.5.3 nyc@10.3.2
6870
npm-rm: beautify-benchmark benchmark
6971

7072
- name: Node.js 4.x
71-
node-version: "4.9"
73+
node-version: "4"
7274
npm-i: mocha@5.2.0 nyc@11.9.0
7375
npm-rm: beautify-benchmark benchmark
7476

7577
- name: Node.js 5.x
76-
node-version: "5.12"
78+
node-version: "5"
7779
npm-i: mocha@5.2.0 nyc@11.9.0
7880
npm-rm: beautify-benchmark benchmark
7981

8082
- name: Node.js 6.x
81-
node-version: "6.17"
83+
node-version: "6"
8284
npm-i: mocha@6.2.2 nyc@14.1.1
8385
npm-rm: beautify-benchmark benchmark
8486

8587
- name: Node.js 7.x
86-
node-version: "7.10"
88+
node-version: "7"
8789
npm-i: mocha@6.2.2 nyc@14.1.1
8890
npm-rm: beautify-benchmark benchmark
8991

9092
- name: Node.js 8.x
91-
node-version: "8.17"
93+
node-version: "8"
9294
npm-i: mocha@7.2.0 nyc@14.1.1
9395
npm-rm: beautify-benchmark benchmark
9496

9597
- name: Node.js 9.x
96-
node-version: "9.11"
98+
node-version: "9"
9799
npm-i: mocha@7.2.0 nyc@14.1.1
98100
npm-rm: beautify-benchmark benchmark
99101

100102
- name: Node.js 10.x
101-
node-version: "10.24"
103+
node-version: "10"
102104
npm-rm: beautify-benchmark benchmark
103105

104106
- name: Node.js 11.x
105-
node-version: "11.15"
107+
node-version: "11"
106108
npm-rm: beautify-benchmark benchmark
107109

108110
- name: Node.js 12.x
109-
node-version: "12.22"
111+
node-version: "12"
110112
npm-rm: beautify-benchmark benchmark
111113

112114
- name: Node.js 13.x
113-
node-version: "13.14"
115+
node-version: "13"
114116
npm-rm: beautify-benchmark benchmark
115117

116118
- name: Node.js 14.x
117-
node-version: "14.17"
119+
node-version: "14"
118120
npm-rm: beautify-benchmark benchmark
119121

120122
- name: Node.js 15.x
121-
node-version: "15.14"
123+
node-version: "15"
122124
npm-rm: beautify-benchmark benchmark
123125

124126
- name: Node.js 16.x
125-
node-version: "16.2"
127+
node-version: "16"
126128
npm-rm: beautify-benchmark benchmark
127129

128130
- name: Node.js 17.x
129-
node-version: "17.9"
131+
node-version: "17"
130132
npm-rm: beautify-benchmark benchmark
131133

132134
- name: Node.js 18.x
133-
node-version: "18.18"
135+
node-version: "18"
134136
npm-rm: beautify-benchmark benchmark
135137

136138
- name: Node.js 19.x
137-
node-version: "19.9"
139+
node-version: "19"
138140
npm-rm: beautify-benchmark benchmark
139141

140142
- name: Node.js 20.x
141-
node-version: "20.9"
143+
node-version: "20"
142144
npm-rm: beautify-benchmark benchmark
143145

144146
- name: Node.js 21.x
145-
node-version: "21.7"
147+
node-version: "21"
146148
npm-rm: beautify-benchmark benchmark
147149

148150
- name: Node.js 22.x
149-
node-version: "22.0"
151+
node-version: "22"
152+
npm-rm: beautify-benchmark benchmark
153+
154+
- name: Node.js 23.x
155+
node-version: "23"
156+
npm-rm: beautify-benchmark benchmark
157+
158+
- name: Node.js 24.x
159+
node-version: "24"
160+
npm-rm: beautify-benchmark benchmark
161+
162+
- name: Node.js 25.x
163+
node-version: "25"
164+
npm-rm: beautify-benchmark benchmark
165+
166+
- name: Node.js 26.x
167+
node-version: "26"
150168
npm-rm: beautify-benchmark benchmark
151169

152170
steps:
153-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
171+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
154172

155173
- name: Install Node.js ${{ matrix.node-version }}
156174
shell: bash -eo pipefail -l {0}
@@ -162,7 +180,7 @@ jobs:
162180
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
163181
164182
- name: Configure npm
165-
run: |
183+
run: |
166184
if [[ "$(npm config get package-lock)" == "true" ]]; then
167185
npm config set package-lock false
168186
else
@@ -199,7 +217,7 @@ jobs:
199217
echo "node@$(node -v)"
200218
echo "npm@$(npm -v)"
201219
npm -s ls ||:
202-
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
220+
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT"
203221
204222
- name: Run tests
205223
shell: bash
@@ -214,22 +232,38 @@ jobs:
214232
if: steps.list_env.outputs.eslint != ''
215233
run: npm run lint
216234

217-
- name: Collect code coverage
218-
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # master
235+
- name: Upload code coverage
236+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
219237
if: steps.list_env.outputs.nyc != ''
220238
with:
221-
github-token: ${{ secrets.GITHUB_TOKEN }}
222-
flag-name: run-${{ matrix.test_number }}
223-
parallel: true
239+
name: coverage-node-${{ matrix.node-version }}
240+
path: ./coverage/lcov.info
241+
retention-days: 1
224242

225243
coverage:
226-
permissions:
227-
checks: write # for coverallsapp/github-action to create new checks
228244
needs: test
229245
runs-on: ubuntu-latest
246+
permissions:
247+
contents: read
248+
checks: write # for coverallsapp/github-action to create new checks
230249
steps:
231-
- name: Upload code coverage
232-
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # master
250+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
251+
252+
- name: Install lcov
253+
shell: bash
254+
run: sudo apt-get -y install lcov
255+
256+
- name: Collect coverage reports
257+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
258+
with:
259+
path: ./coverage
260+
pattern: coverage-node-*
261+
262+
- name: Merge coverage reports
263+
shell: bash
264+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
265+
266+
- name: Upload coverage report
267+
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
233268
with:
234-
github-token: ${{ secrets.GITHUB_TOKEN }}
235-
parallel-finished: true
269+
file: ./lcov.info

0 commit comments

Comments
 (0)