diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index caf4704..9ea0661 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -2,9 +2,6 @@ name: Elixir CI on: push: - branches: [ main ] - pull_request: - branches: [ main ] permissions: contents: read @@ -14,6 +11,14 @@ jobs: name: Build and test runs-on: ubuntu-latest + services: + postgres: + image: postgres + env: + POSTGRES_USER: isn + POSTGRES_PASSWORD: secret + ports: + - 5432:5432 steps: - uses: actions/checkout@v3 @@ -32,3 +37,6 @@ jobs: run: mix deps.get - name: Run tests run: mix test + env: + POSTGRES_USER: isn + POSTGRES_PASSWORD: secret diff --git a/test/test_helper.exs b/test/test_helper.exs index 04c7824..1ef692c 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -10,8 +10,8 @@ defmodule ISN.TestHelper do database: "isn_test" ] - db_user = System.get_env("DATABASE_POSTGRESQL_USERNAME") - db_pass = System.get_env("DATABASE_POSTGRESQL_PASSWORD") + db_user = System.get_env("POSTGRES_USER") + db_pass = System.get_env("POSTGRES_PASSWORD") db_options = if db_user do