Skip to content

Commit

Permalink
service per job
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Oct 10, 2024
1 parent b504cb1 commit f9f1885
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ env:
CARGO_TERM_COLOR: always
DATABASE_URL: postgres://postgres:postgres@postgres:5432/underway

postgres_service: &postgres_service
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: underway
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
jobs:
check:
runs-on: ubuntu-latest

services:
<<: *postgres_service
steps:
- uses: actions/checkout@v4
- run: |
Expand All @@ -26,21 +40,10 @@ jobs:
run: |
cargo +nightly fmt --all -- --check
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: underway
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
check-docs:
runs-on: ubuntu-latest
services:
<<: *postgres_service
steps:
- uses: actions/checkout@v4
- run: |
Expand All @@ -55,6 +58,8 @@ jobs:
test-docs:
needs: check
runs-on: ubuntu-latest
services:
<<: *postgres_service
steps:
- uses: actions/checkout@v4
- run: |
Expand All @@ -67,6 +72,8 @@ jobs:
test-lib:
needs: check
runs-on: ubuntu-latest
services:
<<: *postgres_service
steps:
- uses: actions/checkout@v4
- run: |
Expand Down

0 comments on commit f9f1885

Please sign in to comment.