Skip to content

Commit 30ae22a

Browse files
committed
feat(ci): add GitHub Actions CI workflow with test, typecheck, and build jobs
Add CI that runs tests, typecheck, and build verification on push/PR to master. Include test script in package.json and new .github/workflows/ci.yml. Adds: - .github/workflows/ci.yml: CI workflow with test, typecheck, and build jobs - package.json: test script entry 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent 346aba0 commit 30ae22a

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: latest
22+
23+
- name: Install dependencies
24+
run: bun install
25+
env:
26+
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
27+
28+
- name: Run tests
29+
run: bun test
30+
31+
typecheck:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: oven-sh/setup-bun@v2
37+
with:
38+
bun-version: latest
39+
40+
- name: Install dependencies
41+
run: bun install
42+
env:
43+
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
44+
45+
- name: Type check
46+
run: bun run typecheck
47+
48+
build:
49+
runs-on: ubuntu-latest
50+
needs: [test, typecheck]
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: oven-sh/setup-bun@v2
55+
with:
56+
bun-version: latest
57+
58+
- name: Install dependencies
59+
run: bun install
60+
env:
61+
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
62+
63+
- name: Build
64+
run: bun run build
65+
66+
- name: Verify build output
67+
run: |
68+
test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1)
69+
test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"build:schema": "bun run script/build-schema.ts",
2525
"clean": "rm -rf dist",
2626
"prepublishOnly": "bun run clean && bun run build",
27-
"typecheck": "tsc --noEmit"
27+
"typecheck": "tsc --noEmit",
28+
"test": "bun test"
2829
},
2930
"keywords": [
3031
"opencode",

0 commit comments

Comments
 (0)