Skip to content

Commit

Permalink
add DB to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoch-cars committed Sep 17, 2024
1 parent 53a5310 commit a668570
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ permissions:
contents: read

jobs:
services:
postgres:
image: postgres:11
ports: ['5432:5432']
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: --health-cmd pg_isready --health-interval 10s --health-timeout 10s --health-retries 5

build:

name: Build and test
Expand All @@ -27,6 +35,10 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
DATABASE_HOST: postgres
# POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
MIX_ENV: test
run: mix test

- name: Set up Elixir v1.17 OTP26
Expand All @@ -37,6 +49,10 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
DATABASE_HOST: postgres
# POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
MIX_ENV: test
run: mix test

- name: Set up Elixir v1.17 OTP27
Expand All @@ -47,4 +63,9 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
DATABASE_HOST: postgres
# POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
MIX_ENV: test

run: mix test

0 comments on commit a668570

Please sign in to comment.