Files
windmill/.github/workflows/backend-test.yml
2022-08-12 02:57:26 +02:00

41 lines
1.2 KiB
YAML

name: Backend only integration tests
on:
push:
branches:
- "main"
paths:
- "backend/**"
- ".github/workflows/backend-test.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "backend/**"
- ".github/workflows/backend-test.yml"
jobs:
cargo_test:
runs-on: [self-hosted, new]
services:
postgres:
image: postgres
env:
POSTGRES_DB: windmill
POSTGRES_USER: admin
POSTGRES_PASSWORD: changeme
ports:
- 5434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- run: /root/.cargo/bin/rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- run: psql postgres://admin:changeme@localhost:5434/windmill -c "CREATE ROLE app LOGIN PASSWORD 'changeme';"
- name: "cargo test"
timeout-minutes: 5
run: mkdir -p frontend/build && cd backend && SQLX_OFFLINE=true DATABASE_URL=postgres://admin:changeme@localhost:5434/windmill /root/.cargo/bin/cargo test