Skip to content

Commit 36ec9ba

Browse files
committed
[actions] Add backend test
1 parent e5c883e commit 36ec9ba

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@ jobs:
66
build-frontend:
77
runs-on: ubuntu-latest
88

9-
defaults:
10-
run:
11-
working-directory: main
9+
services:
10+
db:
11+
image: postgres
12+
ports:
13+
- 60232:5432
14+
env:
15+
POSTGRES_NAME: secrethome
16+
POSTGRES_USER: secrethome
17+
POSTGRES_PASSWORD: secrethome
18+
options: >-
19+
--health-cmd "pg_isready"
20+
--health-interval 10s
21+
--health-timeout 5s
22+
--health-retries 5
1223
1324
steps:
1425
- name: Checkout
@@ -26,5 +37,22 @@ jobs:
2637
- name: Install dependencies
2738
run: pnpm install
2839

29-
- name: Build
40+
- name: Build frontend
41+
working-directory: main
3042
run: pnpm run build
43+
44+
- name: Push database
45+
working-directory: main
46+
run: pnpm drizzle-kit push
47+
48+
- name: Setup rust-toolchain
49+
uses: dtolnay/rust-toolchain@stable
50+
51+
- name: Cache rust
52+
uses: Swatinem/rust-cache@v2
53+
54+
- name: Check backend
55+
working-directory: backend
56+
env:
57+
DATABASE_URL: postgres://secrethome:[email protected]:60232/secrethome
58+
run: cargo check

0 commit comments

Comments
 (0)