Skip to content

Database Migrations + Repositories + Model Updates #4

Database Migrations + Repositories + Model Updates

Database Migrations + Repositories + Model Updates #4

Workflow file for this run

name: Rust CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres
- name: Create test database
run: sqlx database create
- name: Run migrations
run: sqlx migrate run --source ./server/libs/db-common/migrations
- run: cargo test --all-features