Skip to content

Commit c36bdff

Browse files
committed
feat: running unit test and smoke test on github action
1 parent 9c1b376 commit c36bdff

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
unit-test:
11+
name: Unit Tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: 10.28.0
22+
23+
- name: Use Node.js 24
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '24'
27+
cache: 'pnpm'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Run unit tests
33+
run: pnpm run test:unit
34+
35+
smoke-test:
36+
name: Smoke Tests
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Setup pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: 10.28.0
47+
48+
- name: Use Node.js 24
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: '24'
52+
cache: 'pnpm'
53+
54+
- name: Install dependencies
55+
run: pnpm install --frozen-lockfile
56+
57+
- name: Run smoke tests
58+
run: pnpm run test:smoke

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"posttest": "pnpm run lint",
7676
"prepack": "pnpm run build && oclif manifest && oclif readme",
7777
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
78+
"test:unit": "mocha --forbid-only \"test/**/*.test.ts\" --exclude \"test/integration/**/*\" --exclude \"test/smoke/**/*\"",
7879
"test:smoke": "pnpm run build && mocha --forbid-only \"test/smoke/**/*.test.ts\"",
7980
"version": "oclif readme && git add README.md"
8081
},

0 commit comments

Comments
 (0)