Skip to content

Commit 82d3190

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 82d3190

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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: |
34+
curl -L https://encore.dev/install.sh | bash
35+
echo "$HOME/.encore/bin" >> $GITHUB_PATH
36+
37+
- name: Install backend dependencies
38+
working-directory: ./backend
39+
run: bun install
40+
41+
- name: Run backend tests
42+
working-directory: ./backend
43+
run: encore test
44+
env:
45+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
46+
47+
- name: Build backend
48+
working-directory: ./backend
49+
run: encore build
50+
51+
- name: Install frontend dependencies
52+
working-directory: ./frontend
53+
run: bun install
54+
55+
- name: Run frontend tests
56+
working-directory: ./frontend
57+
run: bun test
58+
59+
- name: Build frontend
60+
working-directory: ./frontend
61+
run: bun run build

0 commit comments

Comments
 (0)