ci: add backend test workflow
Some checks failed
Backend CI / test (push) Has been cancelled
Some checks failed
Backend CI / test (push) Has been cancelled
This commit is contained in:
38
.github/workflows/backend.yml
vendored
Normal file
38
.github/workflows/backend.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Backend CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ["backend/**", ".github/workflows/backend.yml"]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths: ["backend/**", ".github/workflows/backend.yml"]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: backend
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: pass
|
||||
POSTGRES_DB: loft_test
|
||||
ports: ["5432:5432"]
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres"
|
||||
--health-interval 5s --health-timeout 5s --health-retries 5
|
||||
env:
|
||||
DATABASE_URL: postgres://postgres:pass@localhost:5432/loft_test
|
||||
STORAGE_PATH: /tmp/loft-files-test
|
||||
SQLX_OFFLINE: "true"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo install sqlx-cli --no-default-features --features postgres,rustls
|
||||
- run: sqlx migrate run
|
||||
- run: mkdir -p /tmp/loft-files-test
|
||||
- run: cargo test
|
||||
Reference in New Issue
Block a user