Skip to content

Commit a87f302

Browse files
feat: add gh action to check code and test cases (#6)
* feat: add gh action to check code and test cases * feat: add build command
1 parent d53057a commit a87f302

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install Bun
18+
uses: oven-sh/setup-bun@v1
19+
20+
- name: Start docker compose
21+
run: |
22+
docker compose down --volumes --remove-orphans || true
23+
docker compose up -d
24+
sleep 3
25+
26+
- name: Install dependencies
27+
run: bun install
28+
29+
- name: Run tests
30+
run: bun test
31+
32+
- name: Build project
33+
run: bun run build
34+
35+
- name: Stop docker compose
36+
if: always()
37+
run: docker compose down --volumes --remove-orphans

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "bun --hot run index.ts",
88
"start": "bun index.ts",
9-
"test": "bun test"
9+
"test": "bun test",
10+
"build": "bun build index.ts --outdir dist --minify --target bun"
1011
},
1112
"devDependencies": {
1213
"@types/bun": "latest",

0 commit comments

Comments
 (0)