Set up PostgreSQL with GitHub Actions

This commit is contained in:
Martin Frost 2022-05-10 23:16:07 +02:00
parent fe9f68b334
commit c68b4128da
2 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -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