- add db to ci workflow

This commit is contained in:
Kaimbacher 2023-05-09 14:57:48 +02:00
parent fd67172a8d
commit b7c134ab73

View File

@ -10,6 +10,19 @@ jobs:
japa-tests: japa-tests:
# run build on latest ubuntu # run build on latest ubuntu
runs-on: ubuntu-latest runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: ProjectName
POSTGRES_PASSWORD: password
POSTGRES_DB: ProjectName-test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps: steps:
# this will check out the current branch (https://github.com/actions/checkout#Push-a-commit-using-the-built-in-token) # this will check out the current branch (https://github.com/actions/checkout#Push-a-commit-using-the-built-in-token)
- name: Check out repository code - name: Check out repository code
@ -36,6 +49,12 @@ jobs:
- name: Run tests - name: Run tests
run: node ace test run: node ace test
env: env:
DB_CONNECTION: pg
PG_HOST: postgres
PG_PORT: 5432
PG_USER: ProjectName
PG_PASSWORD: password
PG_DB_NAME: ProjectName-test
PORT: 3333 PORT: 3333
HOST: 0.0.0.0 HOST: 0.0.0.0
APP_KEY: somefakekeythatis>16characters APP_KEY: somefakekeythatis>16characters