Skip to content

Commit 28c9751

Browse files
committed
ci(cicd): update workflow
1 parent 66d56b1 commit 28c9751

File tree

2 files changed

+55
-21
lines changed

2 files changed

+55
-21
lines changed

.github/workflows/checks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: test
2+
on:
3+
- push
4+
- pull_request
5+
- workflow_call
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 21
15+
- run: npm install
16+
- run: npm run lint
17+
18+
typecheck:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version: 21
25+
- run: npm install
26+
- run: npm run typecheck
27+
28+
tests:
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
os: [ubuntu-latest, windows-latest]
33+
node-version:
34+
- 20.x
35+
- 21.x
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
- name: Install
43+
run: npm install
44+
- name: Run lint
45+
run: npm run lint
46+
- name: Run typecheck
47+
run: npm run typecheck
48+
- name: Run tests
49+
run: npm test

.github/workflows/release.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
1-
name: Publish Package to npmjs
1+
name: release
22

3-
on:
4-
push:
5-
branches:
6-
- main
3+
on: workflow_dispatch
74

85
permissions:
96
contents: write
10-
pages: write
7+
id-token: write
118

129
jobs:
13-
test:
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: [ubuntu-latest, windows-latest]
18-
node-version:
19-
- 20.x
20-
- 21.x
21-
steps:
22-
- uses: actions/checkout@v4
23-
- name: Install
24-
run: npm install
25-
- name: Run lint
26-
run: npm run lint
10+
checks:
11+
uses: ./.github/workflows/checks.yml
2712

2813
release:
2914
runs-on: ubuntu-latest
30-
needs: [test]
15+
needs: checks
3116
permissions:
3217
contents: write
3318
id-token: write

0 commit comments

Comments
 (0)