Skip to content

Commit

Permalink
Add db to every job
Browse files Browse the repository at this point in the history
Need  to get rid of the duplication though.
  • Loading branch information
ftassi committed Sep 15, 2023
1 parent 5b98563 commit c84f193
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,27 @@ jobs:
with:
components: rustfmt
- name: Enforce formatting
run: cargo fmt --check
run: |
cargo install sqlx-cli --no-default-features --features rustls,postgres
sqlx database create
sqlx migrate run
cargo fmt --check
services:
db:
image: postgres:15.4
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_PORT: 5432
POSTGRES_HOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
clippy:
name: Clippy
Expand All @@ -56,7 +76,24 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Linting
run: cargo clippy -- -D warnings
run: |
cargo clippy -- -D warnings
services:
db:
image: postgres:15.4
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_PORT: 5432
POSTGRES_HOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
coverage:
name: Code coverage
Expand All @@ -70,3 +107,19 @@ jobs:
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace
services:
db:
image: postgres:15.4
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_PORT: 5432
POSTGRES_HOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

0 comments on commit c84f193

Please sign in to comment.