Skip to content

Commit

Permalink
build action sqlx
Browse files Browse the repository at this point in the history
  • Loading branch information
mbund committed Mar 9, 2024
1 parent 5af63db commit b5916c5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4

Expand All @@ -21,6 +31,14 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install sqlx-cli
run: |
cargo install sqlx-cli --no-default-features --features postgres
- name: Migrate database
run: |
DATABASE_URL=postgres://postgres:postgres@localhost/postgres sqlx migrate run
- name: Build
run: |
cargo build

0 comments on commit b5916c5

Please sign in to comment.