Skip to content

Commit cd728c6

Browse files
authored
feat: add testing setup with ci workflow (#2)
1 parent 4600d8f commit cd728c6

File tree

12 files changed

+625
-59
lines changed

12 files changed

+625
-59
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize]
7+
8+
concurrency:
9+
group: ci-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
name: Test
15+
timeout-minutes: 15
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
node-version: [22.x]
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: pnpm/action-setup@v4
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: pnpm
31+
32+
- name: Install deps
33+
run: |
34+
pnpm i --frozen-lockfile
35+
36+
- name: Lint
37+
run: pnpm lint
38+
39+
- name: Test
40+
run: pnpm test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_modules
55
.idea/
66
.pnpm-store/
77

8+
coverage/
89
dist/
910
storybook-static/
1011
fanciers-echarts-react-*.tgz

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"scripts": {
3030
"dev": "storybook dev",
31+
"test": "vitest",
3132
"prepack": "tsdown",
3233
"lint": "tsc --noEmit"
3334
},
@@ -46,7 +47,8 @@
4647
"storybook-react-rsbuild": "^2.1.0",
4748
"swr": "^2.3.6",
4849
"tsdown": "^0.14.2",
49-
"typescript": "^5.9.2"
50+
"typescript": "^5.9.2",
51+
"vitest": "^3.2.4"
5052
},
5153
"peerDependencies": {
5254
"echarts": "^6.0.0",

0 commit comments

Comments
 (0)