Skip to content

Commit 7db2df8

Browse files
committed
Add GitHub Actions CI workflow
- Add CI workflow for pull requests to main branch - Includes PostgreSQL service for database testing - Runs backend tests with Encore CLI - Runs frontend tests with Bun - Builds both backend and frontend - Uses latest Bun version and Encore CLI
1 parent 6a03784 commit 7db2df8

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
postgres:
13+
image: postgres:15
14+
env:
15+
POSTGRES_PASSWORD: postgres
16+
POSTGRES_DB: test
17+
options: >-
18+
--health-cmd pg_isready
19+
--health-interval 10s
20+
--health-timeout 5s
21+
--health-retries 5
22+
ports:
23+
- 5432:5432
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: oven-sh/setup-bun@v1
29+
with:
30+
bun-version: latest
31+
32+
- name: Install Encore CLI
33+
run: curl -L https://encore.dev/install.sh | bash
34+
35+
- name: Install backend dependencies
36+
working-directory: ./backend
37+
run: bun install
38+
39+
- name: Run backend tests
40+
working-directory: ./backend
41+
run: encore test
42+
env:
43+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
44+
45+
- name: Build backend
46+
working-directory: ./backend
47+
run: encore build
48+
49+
- name: Install frontend dependencies
50+
working-directory: ./frontend
51+
run: bun install
52+
53+
- name: Run frontend tests
54+
working-directory: ./frontend
55+
run: bun test
56+
57+
- name: Build frontend
58+
working-directory: ./frontend
59+
run: bun run build

0 commit comments

Comments
 (0)