Skip to content

Commit 7dd1e55

Browse files
authored
feat: limit support to node >=18 (#1303)
1 parent 690fc51 commit 7dd1e55

File tree

4 files changed

+197
-18
lines changed

4 files changed

+197
-18
lines changed

.github/workflows/legacy.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: legacy
2+
3+
on:
4+
push:
5+
branches:
6+
- v3
7+
pull_request:
8+
branches:
9+
- v3
10+
11+
permissions:
12+
contents: read
13+
14+
# Cancel in progress workflows
15+
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
16+
concurrency:
17+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
18+
cancel-in-progress: true
19+
20+
jobs:
21+
test:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-latest, windows-latest]
26+
node-version: [16, 17]
27+
# Node.js release schedule: https://nodejs.org/en/about/releases/
28+
29+
name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}
30+
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
with:
35+
persist-credentials: false
36+
37+
- name: Setup Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
42+
- name: Configure npm loglevel
43+
run: |
44+
npm config set loglevel error
45+
shell: bash
46+
47+
- name: Install dependencies
48+
run: npm install
49+
50+
- name: Output Node and NPM versions
51+
run: |
52+
echo "Node.js version: $(node -v)"
53+
echo "NPM version: $(npm -v)"
54+
55+
- name: Run tests
56+
shell: bash
57+
run: npm run test:ci
58+
59+
- name: Upload code coverage
60+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
61+
with:
62+
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
63+
path: ./coverage/lcov.info
64+
retention-days: 1
65+
66+
coverage:
67+
needs: test
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
71+
checks: write
72+
steps:
73+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
74+
75+
- name: Install lcov
76+
shell: bash
77+
run: sudo apt-get -y install lcov
78+
79+
- name: Collect coverage reports
80+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
81+
with:
82+
path: ./coverage
83+
pattern: coverage-node-*
84+
85+
- name: Merge coverage reports
86+
shell: bash
87+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
88+
89+
- name: Upload coverage report
90+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
91+
with:
92+
file: ./lcov.info

.github/workflows/test.yml

Lines changed: 96 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,108 @@
1-
name: Node CI
1+
name: ci
22

33
on:
4-
pull_request:
5-
branches:
6-
- v3
74
push:
85
branches:
9-
- v3
6+
- v3
7+
pull_request:
8+
branches:
9+
- v3
10+
11+
permissions:
12+
contents: read
13+
14+
# Cancel in progress workflows
15+
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
16+
concurrency:
17+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
18+
cancel-in-progress: true
1019

1120
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Setup Node.js
27+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28+
with:
29+
node-version: 'lts/*'
30+
31+
- name: Install dependencies
32+
run: npm install --ignore-scripts --include=dev
33+
34+
- name: Run lint
35+
run: npm run lint
36+
1237
test:
1338
strategy:
1439
fail-fast: false
1540
matrix:
16-
os: [ubuntu-latest, macOS-latest, windows-latest]
17-
node: [12.20.0, 14.13.1, 16.0.0, 16, 17, 18, 19, 20, 21, 22, 23, 24]
41+
os: [ubuntu-latest, macos-latest, windows-latest]
42+
node-version: [18, 19, 20, 21, 22, 23, 24]
43+
# Node.js release schedule: https://nodejs.org/en/about/releases/
44+
45+
name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}
46+
1847
runs-on: ${{ matrix.os }}
1948
steps:
20-
- uses: actions/checkout@v2
21-
- name: Use Node.js ${{ matrix.node }}
22-
uses: actions/setup-node@v2
23-
with:
24-
node-version: ${{ matrix.node }}
25-
- name: Install dependencies
26-
run: npm install
27-
- name: Run tests
28-
run: npm test
49+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
with:
51+
persist-credentials: false
52+
53+
- name: Setup Node.js ${{ matrix.node-version }}
54+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
55+
with:
56+
node-version: ${{ matrix.node-version }}
57+
58+
- name: Configure npm loglevel
59+
run: |
60+
npm config set loglevel error
61+
shell: bash
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Output Node and NPM versions
67+
run: |
68+
echo "Node.js version: $(node -v)"
69+
echo "NPM version: $(npm -v)"
70+
71+
- name: Run tests
72+
shell: bash
73+
run: npm run test:ci
74+
75+
- name: Upload code coverage
76+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
77+
with:
78+
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
79+
path: ./coverage/lcov.info
80+
retention-days: 1
81+
82+
coverage:
83+
needs: test
84+
runs-on: ubuntu-latest
85+
permissions:
86+
contents: read
87+
checks: write
88+
steps:
89+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
90+
91+
- name: Install lcov
92+
shell: bash
93+
run: sudo apt-get -y install lcov
94+
95+
- name: Collect coverage reports
96+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
97+
with:
98+
path: ./coverage
99+
pattern: coverage-node-*
100+
101+
- name: Merge coverage reports
102+
shell: bash
103+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
104+
105+
- name: Upload coverage report
106+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
107+
with:
108+
file: ./lcov.info

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## unreleased
7+
8+
- Support node >=18.0.0
9+
610
## 3.0.0-alpha.1 - 2025-05-23
711

812
- No functional changes compared to `2.0.0-rc.4`.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@
4141
"testdata-w3c-json-form": "^1.0.0"
4242
},
4343
"engines": {
44-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
44+
"node": ">= 18"
4545
},
4646
"files": [
4747
"LICENSE",
4848
"index.js",
4949
"lib/"
5050
],
5151
"scripts": {
52-
"test": "standard && c8 --check-coverage --statements 100 mocha --exit"
52+
"lint": "standard",
53+
"test": "mocha",
54+
"test:ci": "c8 --reporter=lcovonly --reporter=text --check-coverage --statements 100 npm test",
55+
"test:cov": "c8 --reporter=html --reporter=text npm test"
5356
}
5457
}

0 commit comments

Comments
 (0)