Skip to content

Commit

Permalink
ci: add postgres service to test job
Browse files Browse the repository at this point in the history
  • Loading branch information
travipross committed Nov 24, 2024
1 parent 336b5a3 commit 5247ffd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo clippy --all-features --all-targets
- run: cargo clippy --all-features --all-targets --verbose
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt
- run: cargo fmt --verbose
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo test
- name: Install sqlx
run: cargo install sqlx-cli --no-default-features --features postgres
- name: Run migrations
run: sqlx migrate run
- name: Run tests
run: cargo test --all-features --all-targets --verbose
env:
DATABASE_URL: postgres://${{secrets.POSTGRES_USER}}:${{secrets.POSTGRES_PASSWORD}}@database:5432/${{secrets.POSTGRES_DB}}
environment: "Rust CI"
services:
database:
image: postgres:16
env:
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
POSTGRES_DB: ${{secrets.POSTGRES_DB}}

0 comments on commit 5247ffd

Please # to comment.