Skip to content

Commit 63de3a6

Browse files
committed
build: tweaks
1 parent 0eca326 commit 63de3a6

8 files changed

Lines changed: 287 additions & 408 deletions

File tree

.github/workflows/linter-test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Linter Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
linter-and-unit:
13+
name: Linter test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version: 24
26+
cache: pnpm
27+
28+
- name: Install Deps
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Build project
32+
env:
33+
BUNDLE_ANALYSIS: true
34+
run: pnpm run build
35+
36+
- name: Linter test
37+
run: |
38+
pnpm run lint:check
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
name: Test
1+
name: Unit Test
22

33
on:
44
push:
55
pull_request:
6-
branches:
7-
- main
86

97
permissions:
108
contents: read
9+
id-token: write
1110

1211
jobs:
1312
linter-and-unit:
14-
name: Linter and Unit test
13+
name: Unit test
1514
runs-on: ubuntu-latest
1615
strategy:
1716
fail-fast: false
@@ -36,31 +35,24 @@ jobs:
3635
- name: Install Deps
3736
run: pnpm install --frozen-lockfile
3837

39-
- name: Build project and upload bundle
40-
if: ${{ !cancelled() && matrix.node-version == 24 }}
41-
env:
42-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
43-
run: pnpm run build
44-
45-
- name: Linter test
46-
if: ${{ !cancelled() && matrix.node-version == 24 }}
47-
run: pnpm lint
38+
- name: Build project
39+
run: pnpm build
4840

4941
- name: Unit test and save results
5042
env:
51-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
52-
NODE_OPTIONS: --max_old_space_size=8192
43+
TEST_REPORT: ${{ matrix.node-version == 24 && 'true' || '' }}
5344
run: pnpm run test
5445

55-
- name: Upload coverage
56-
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && matrix.node-version == 24 }}
46+
- name: Upload test results
47+
if: ${{ !cancelled() && matrix.node-version == 24 }}
5748
uses: codecov/codecov-action@v5
5849
with:
59-
token: ${{ secrets.CODECOV_TOKEN }}
50+
use_oidc: true
51+
files: ./coverage/test-report.junit.xml
52+
report_type: test_results
6053

61-
- name: Upload test results
62-
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && matrix.node-version == 24 }}
63-
uses: codecov/test-results-action@v1
54+
- name: Upload coverage
55+
if: ${{ !cancelled() && matrix.node-version == 24 }}
56+
uses: codecov/codecov-action@v5
6457
with:
65-
file: ./coverage/test-report.junit.xml
66-
token: ${{ secrets.CODECOV_TOKEN }}
58+
use_oidc: true

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
},
4444
"scripts": {
4545
"bench": "vitest bench",
46-
"build": "tsdown",
46+
"build": "tsdown --config-loader unrun",
4747
"clean": "rimraf dist",
48-
"dev": "tsdown -w",
48+
"dev": "tsdown --config-loader unrun -w",
4949
"lint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives --deny-warnings && oxfmt",
5050
"lint:check": "oxlint --type-aware --type-check --report-unused-disable-directives --deny-warnings && oxfmt --check",
5151
"prepare": "husky",

0 commit comments

Comments
 (0)