Skip to content

Commit b25f357

Browse files
authored
Merge branch 'master' into chore/ci-yml
2 parents a2f3254 + c10ee74 commit b25f357

File tree

1 file changed

+21
-28
lines changed

1 file changed

+21
-28
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,35 @@ jobs:
9595

9696
- name: Node.js 8.x
9797
node-version: "8.17"
98-
npm-i: mocha@7.2.0 nyc@14.1.1
98+
npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6
9999

100100
- name: Node.js 9.x
101101
node-version: "9.11"
102-
npm-i: mocha@7.2.0 nyc@14.1.1
102+
npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6
103103

104104
- name: Node.js 10.x
105105
node-version: "10.24"
106-
npm-i: mocha@8.4.0
106+
npm-i: mocha@8.4.0 supertest@6.1.6
107107

108108
- name: Node.js 11.x
109109
node-version: "11.15"
110-
npm-i: mocha@8.4.0
110+
npm-i: mocha@8.4.0 supertest@6.1.6
111111

112112
- name: Node.js 12.x
113113
node-version: "12.22"
114-
npm-i: mocha@9.2.2
114+
npm-i: mocha@9.2.2 supertest@6.1.6
115115

116116
- name: Node.js 13.x
117117
node-version: "13.14"
118-
npm-i: mocha@9.2.2
118+
npm-i: mocha@9.2.2 supertest@6.1.6
119119

120120
- name: Node.js 14.x
121121
node-version: "14.21"
122+
npm-i: supertest@6.1.6
122123

123124
- name: Node.js 15.x
124125
node-version: "15.14"
126+
npm-i: "supertest@6.1.6"
125127

126128
- name: Node.js 16.x
127129
node-version: "16.20"
@@ -142,7 +144,7 @@ jobs:
142144
node-version: "21.4"
143145

144146
steps:
145-
- uses: actions/checkout@v3
147+
- uses: actions/checkout@v4
146148

147149
- name: Install Node.js ${{ matrix.node-version }}
148150
shell: bash -eo pipefail -l {0}
@@ -201,7 +203,6 @@ jobs:
201203
run: |
202204
if npm -ps ls nyc | grep -q nyc; then
203205
npm run test-ci
204-
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
205206
else
206207
npm test
207208
fi
@@ -210,47 +211,39 @@ jobs:
210211
if: steps.list_env.outputs.eslint != ''
211212
run: npm run lint
212213

213-
- name: Collect code coverage
214-
if: steps.list_env.outputs.nyc != ''
215-
run: |
216-
if [[ -d ./coverage ]]; then
217-
mv ./coverage "./${{ matrix.name }}"
218-
mkdir ./coverage
219-
mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
220-
fi
221-
222214
- name: Upload code coverage
223-
uses: actions/upload-artifact@v3
224-
if: steps.list_env.outputs.nyc != ''
215+
uses: actions/upload-artifact@v4
216+
if: steps.list_env.outputs.nyc != '' && hashFiles('coverage/lcov.info') != ''
225217
with:
226-
name: coverage
227-
path: ./coverage
218+
name: coverage-node-${{ matrix.node-version }}
219+
path: ./coverage/lcov.info
228220
retention-days: 1
229221

230222
coverage:
231-
permissions:
232-
checks: write # for coverallsapp/github-action to create new checks
233-
contents: read # for actions/checkout to fetch code
234223
needs: test
235224
runs-on: ubuntu-latest
225+
permissions:
226+
contents: read # for actions/checkout to fetch code
227+
checks: write # for coverallsapp/github-action to create new checks
236228
steps:
237-
- uses: actions/checkout@v3
229+
- uses: actions/checkout@v4
238230

239231
- name: Install lcov
240232
shell: bash
241233
run: sudo apt-get -y install lcov
242234

243235
- name: Collect coverage reports
244-
uses: actions/download-artifact@v3
236+
uses: actions/download-artifact@v6
245237
with:
246-
name: coverage
247238
path: ./coverage
239+
pattern: coverage-node-*
248240

249241
- name: Merge coverage reports
250242
shell: bash
251-
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
243+
run: find ./coverage -type f -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
252244

253245
- name: Upload coverage report
254246
uses: coverallsapp/github-action@master
255247
with:
256248
github-token: ${{ secrets.GITHUB_TOKEN }}
249+
path-to-lcov: ./lcov.info

0 commit comments

Comments
 (0)