Set up PostgreSQL with GitHub Actions
This commit is contained in:
parent
fe9f68b334
commit
c68b4128da
|
|
@ -2,9 +2,6 @@ name: Elixir CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -14,6 +11,14 @@ jobs:
|
||||||
|
|
||||||
name: Build and test
|
name: Build and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: isn
|
||||||
|
POSTGRES_PASSWORD: secret
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
@ -32,3 +37,6 @@ jobs:
|
||||||
run: mix deps.get
|
run: mix deps.get
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: mix test
|
run: mix test
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: isn
|
||||||
|
POSTGRES_PASSWORD: secret
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ defmodule ISN.TestHelper do
|
||||||
database: "isn_test"
|
database: "isn_test"
|
||||||
]
|
]
|
||||||
|
|
||||||
db_user = System.get_env("DATABASE_POSTGRESQL_USERNAME")
|
db_user = System.get_env("POSTGRES_USER")
|
||||||
db_pass = System.get_env("DATABASE_POSTGRESQL_PASSWORD")
|
db_pass = System.get_env("POSTGRES_PASSWORD")
|
||||||
|
|
||||||
db_options =
|
db_options =
|
||||||
if db_user do
|
if db_user do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue