Skip to content

Commit 63e40de

Browse files
Copilotfengmk2
andcommitted
fix: skip lint on Node.js v16 in GitHub Actions workflow instead of package.json
Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com>
1 parent a735594 commit 63e40de

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/nodejs.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,38 @@ jobs:
1212
name: Node.js
1313
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
1414
with:
15-
version: '16, 18, 20, 22, 24'
15+
version: '18, 20, 22, 24'
1616
secrets:
1717
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18+
19+
Job-Node16:
20+
name: Node.js 16
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
27+
steps:
28+
- name: Checkout Git Source
29+
uses: actions/checkout@v4
30+
31+
- name: Use Node.js 16
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 16
35+
check-latest: true
36+
37+
- name: Install Dependencies
38+
run: npm i --no-package-lock --no-fund
39+
40+
- name: Build
41+
run: npm run prepublishOnly
42+
43+
- name: Run Test
44+
run: npx egg-bin cov
45+
46+
- name: Code Coverage
47+
uses: codecov/codecov-action@v3
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.5.0",
44
"description": "A collection of useful utilities.",
55
"scripts": {
6-
"lint": "node -e \"process.exit(parseInt(process.versions.node) < 18 ? 0 : 1)\" || oxlint src test",
6+
"lint": "oxlint src test",
77
"pretest": "npm run lint -- --fix && npm run prepublishOnly",
88
"test": "egg-bin test",
99
"test-local": "egg-bin test",

0 commit comments

Comments
 (0)