Skip to content

Commit 55475c7

Browse files
authored
ci: updated ci workflow and remove appveyor (#192)
1 parent dc86b4a commit 55475c7

File tree

3 files changed

+74
-148
lines changed

3 files changed

+74
-148
lines changed

.github/workflows/ci.yml

+73-56
Original file line numberDiff line numberDiff line change
@@ -4,78 +4,95 @@ on:
44
push:
55
branches:
66
- master
7-
- '2.0'
87
paths-ignore:
98
- '*.md'
109
pull_request:
1110
paths-ignore:
1211
- '*.md'
1312

13+
permissions:
14+
contents: read
15+
16+
# Cancel in progress workflows
17+
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
18+
concurrency:
19+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
20+
cancel-in-progress: true
21+
1422
jobs:
15-
test:
23+
lint:
24+
name: Lint
1625
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "lts/*"
33+
34+
- name: Install dependencies
35+
run: npm install --ignore-scripts --include=dev
36+
37+
- name: Run lint
38+
run: npm run lint
39+
40+
test:
41+
name: Test - Node.js ${{ matrix.node-version }} - ${{ matrix.os }}
42+
runs-on: ${{ matrix.os }}
1743
strategy:
44+
fail-fast: false
1845
matrix:
19-
name:
20-
- Node.js 18.x
21-
- Node.js 20.x
22-
- Node.js 22.x
46+
os: [ubuntu-latest, windows-latest]
47+
# Node.js release schedule: https://nodejs.org/en/about/releases/
48+
node-version: [18, 19, 20, 21, 22, 23]
49+
steps:
50+
- uses: actions/checkout@v4
2351

24-
include:
25-
- name: Node.js 18.x
26-
node-version: "18"
52+
- name: Setup Node.js ${{ matrix.node-version }}
53+
uses: actions/setup-node@v4
54+
with:
55+
check-latest: true
56+
node-version: ${{ matrix.node-version }}
2757

28-
- name: Node.js 20.x
29-
node-version: "20"
58+
- name: Configure npm loglevel
59+
run: npm config set loglevel error
3060

31-
- name: Node.js 22.x
32-
node-version: "22"
61+
- name: Install dependencies
62+
run: npm install
3363

34-
steps:
35-
- uses: actions/checkout@v4
36-
37-
- name: Install Node.js ${{ matrix.node-version }}
38-
shell: bash -eo pipefail -l {0}
39-
run: |
40-
nvm install --default ${{ matrix.node-version }}
41-
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
42-
43-
- name: Configure npm
44-
run: npm config set package-lock false
45-
46-
- name: Install Node.js dependencies
47-
run: npm install
48-
49-
- name: List environment
50-
id: list_env
51-
shell: bash
52-
run: |
53-
echo "node@$(node -v)"
54-
echo "npm@$(npm -v)"
55-
npm -s ls ||:
56-
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
57-
58-
- name: Run tests
59-
shell: bash
60-
run: npm run test-ci
61-
62-
- name: Lint code
63-
if: steps.list_env.outputs.eslint != ''
64-
run: npm run lint
65-
66-
- name: Collect code coverage
67-
uses: coverallsapp/github-action@master
68-
with:
69-
github-token: ${{ secrets.GITHUB_TOKEN }}
70-
flag-name: run-${{ matrix.test_number }}
71-
parallel: true
64+
- name: Run tests
65+
run: npm run test-ci
66+
67+
- name: Upload code coverage
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
71+
path: ./coverage/lcov.info
72+
retention-days: 1
7273

7374
coverage:
7475
needs: test
7576
runs-on: ubuntu-latest
77+
permissions:
78+
contents: read
79+
checks: write
7680
steps:
77-
- name: Upload code coverage
78-
uses: coverallsapp/github-action@master
79-
with:
80-
github-token: ${{ secrets.github_token }}
81-
parallel-finished: true
81+
- uses: actions/checkout@v4
82+
83+
- name: Install lcov
84+
run: sudo apt-get -y install lcov
85+
86+
- name: Collect coverage reports
87+
uses: actions/download-artifact@v4
88+
with:
89+
path: ./coverage
90+
pattern: coverage-node-*
91+
92+
- name: Merge coverage reports
93+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
94+
95+
- name: Upload coverage report
96+
uses: coverallsapp/github-action@v2
97+
with:
98+
file: ./lcov.info

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[![NPM Version][npm-version-image]][npm-url]
44
[![NPM Downloads][npm-downloads-image]][npm-url]
5-
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
6-
[![Windows Build][appveyor-image]][appveyor-url]
5+
[![CI][github-actions-ci-image]][github-actions-ci-url]
76
[![Test Coverage][coveralls-image]][coveralls-url]
87

98
## Install
@@ -243,8 +242,6 @@ function setCustomCacheControl (res, file) {
243242

244243
[MIT](LICENSE)
245244

246-
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows
247-
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static
248245
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master
249246
[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master
250247
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux

appveyor.yml

-88
This file was deleted.

0 commit comments

Comments
 (0)