Set up PostgreSQL with GitHub Actions
This commit is contained in:
parent
fe9f68b334
commit
c68b4128da
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue