Skip to content

Commit afbb7c8

Browse files
committed
Update package scripts and GitHub Actions CI config.
1 parent 56b0a82 commit afbb7c8

File tree

3 files changed

+50
-12
lines changed

3 files changed

+50
-12
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11
name: CI
22
on: [push, workflow_dispatch]
33
jobs:
4+
prettier:
5+
name: Prettier
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v5
9+
- uses: actions/setup-node@v4
10+
with:
11+
node-version: latest
12+
- run: npm install
13+
- run: node --run prettier
14+
eslint:
15+
name: ESLint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: latest
22+
- run: npm install
23+
- run: node --run eslint
24+
types:
25+
name: Types
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v5
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: latest
32+
- run: npm install
33+
- run: node --run types
434
test:
5-
name: Test with Node.js v${{ matrix.node }} and ${{ matrix.os }}
6-
runs-on: ${{ matrix.os }}
35+
name: Test
736
strategy:
837
matrix:
938
os: [ubuntu-latest, macos-latest]
10-
node: ["20", "22", "24"]
39+
node: [20, 22, 24]
40+
runs-on: ${{ matrix.os }}
1141
steps:
1242
- uses: actions/checkout@v5
13-
- name: Setup Node.js v${{ matrix.node }}
14-
uses: actions/setup-node@v4
43+
- uses: actions/setup-node@v4
1544
with:
1645
node-version: ${{ matrix.node }}
17-
- name: npm install and test
18-
run: npm install-test
46+
- run: npm install
47+
- run: npm run test
48+
if: matrix.node < 22
49+
- run: node --run test
50+
if: matrix.node >= 22

changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88

99
### Patch
1010

11+
- Updated the package scripts:
12+
- Reordered and renamed scripts.
13+
- Replaced `npm run` with `node --run`.
1114
- Updated GitHub Actions CI config:
12-
- Run tests with Node.js v20, v22, v24.
15+
- Run checks in separate jobs.
16+
- Removed custom step names.
1317
- Updated `actions/checkout` to v5.
1418
- Updated `actions/setup-node` to v4.
19+
- Replaced `npm run` with `node --run`.
20+
- Run tests with Node.js v20, v22, v24.
1521

1622
## 18.0.1
1723

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@
6767
"typescript": "^5.2.2"
6868
},
6969
"scripts": {
70-
"eslint": "eslint .",
7170
"prettier": "prettier -c .",
71+
"eslint": "eslint .",
7272
"types": "tsc -p jsconfig.json",
73-
"tests": "coverage-node --test-reporter=spec --test",
74-
"test": "npm run eslint && npm run prettier && npm run types && npm run tests",
75-
"prepublishOnly": "npm test"
73+
"test": "coverage-node --test-reporter=spec --test",
74+
"check": "node --run prettier && node --run eslint && node --run types && node --run test",
75+
"prepublishOnly": "node --run check"
7676
}
7777
}

0 commit comments

Comments
 (0)