Skip to content

Commit 281ee67

Browse files
committed
build: improve github workflows
1 parent 8157b75 commit 281ee67

3 files changed

Lines changed: 90 additions & 9 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
# This allows a subsequently queued workflow run to interrupt previous runs
12+
concurrency:
13+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
persist-credentials: false
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v3
28+
29+
- uses: pnpm/action-setup@v2.2.2
30+
name: Install pnpm
31+
id: pnpm-install
32+
with:
33+
version: 7
34+
run_install: true
35+
36+
- name: Install dependencies
37+
run: pnpm install --ignore-scripts
38+
39+
- name: Coverage
40+
run: pnpm run test:coverage
41+
42+
- name: Upload Coverage
43+
uses: codecov/codecov-action@v3
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+

.github/workflows/linter.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
# This allows a subsequently queued workflow run to interrupt previous runs
12+
concurrency:
13+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
persist-credentials: false
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v3
28+
29+
- uses: pnpm/action-setup@v2.2.2
30+
name: Install pnpm
31+
id: pnpm-install
32+
with:
33+
version: 7
34+
run_install: true
35+
36+
- name: Install dependencies
37+
run: pnpm install --ignore-scripts
38+
39+
- name: Linter
40+
run: pnpm run format:ci
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: test
22

33
on:
44
push:
@@ -14,12 +14,12 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
test:
18-
runs-on: ubuntu-latest
17+
build:
1918
strategy:
2019
matrix:
2120
node-version: [14, 16, 18]
2221
os: [macos-latest, ubuntu-latest, windows-latest]
22+
runs-on: ${{ matrix.os }}
2323
permissions:
2424
contents: read
2525
steps:
@@ -30,7 +30,7 @@ jobs:
3030
- name: Use Node.js
3131
uses: actions/setup-node@v3
3232
with:
33-
node-version: 'lts/*'
33+
node-version: ${{ matrix.node-version }}
3434

3535
- uses: pnpm/action-setup@v2.2.2
3636
name: Install pnpm
@@ -42,10 +42,5 @@ jobs:
4242
- name: Install dependencies
4343
run: pnpm install --ignore-scripts
4444

45-
- name: Linter
46-
run: pnpm run format:ci
47-
4845
- name: Test
4946
run: pnpm test
50-
51-

0 commit comments

Comments
 (0)