parent
acf69d718c
commit
9f90118596
1 changed files with 14 additions and 15 deletions
|
@ -8,29 +8,25 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Docker Hub image that `container-job` executes in
|
||||||
|
container: node:20-bookworm-slim
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mydb:
|
mydb:
|
||||||
image: postgres:latest
|
image: postgres:latest
|
||||||
# container_name: mydb
|
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: alice
|
POSTGRES_USER: alice
|
||||||
POSTGRES_PASSWORD: iEx4Vj7zBb6
|
POSTGRES_PASSWORD: iEx4Vj7zBb6
|
||||||
POSTGRES_DB: tethys_dev
|
POSTGRES_DB: tethys_dev
|
||||||
ports:
|
# ports:
|
||||||
# Maps tcp port 5432 on service container to the host
|
# - 5432:5432
|
||||||
- 5433:5433
|
|
||||||
# Set health checks to wait until postgres has started
|
|
||||||
options: |
|
options: |
|
||||||
--health-cmd pg_isready
|
--health-cmd pg_isready
|
||||||
--hostname mydb
|
--hostname mydb
|
||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
env:
|
|
||||||
POSTGRES_HOST: localhost
|
|
||||||
POSTGRES_PORT: 5433
|
|
||||||
POSTGRES_PASSWORD: iEx4Vj7zBb6
|
|
||||||
POSTGRES_USER: alice
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -47,12 +43,15 @@ jobs:
|
||||||
run: cp .env.example .env.test
|
run: cp .env.example .env.test
|
||||||
|
|
||||||
- name: Set up environment variables
|
- name: Set up environment variables
|
||||||
# env:
|
env:
|
||||||
# PG_HOST: localhost
|
POSTGRES_HOST: mydb
|
||||||
|
POSTGRES_PORT: 5432
|
||||||
|
POSTGRES_PASSWORD: iEx4Vj7zBb6
|
||||||
|
POSTGRES_USER: alice
|
||||||
run: |
|
run: |
|
||||||
echo "DB_CONNECTION=pg" >> .env.test
|
echo "DB_CONNECTION=pg" >> .env.test
|
||||||
echo "PG_HOST=localhost" >> .env.test
|
echo "PG_HOST=mydb" >> .env.test
|
||||||
echo "PG_PORT=5433" >> .env.test
|
echo "PG_PORT=5432" >> .env.test
|
||||||
echo "PG_USER=alice" >> .env.test
|
echo "PG_USER=alice" >> .env.test
|
||||||
echo "PG_PASSWORD=iEx4Vj7zBb6" >> .env.test
|
echo "PG_PASSWORD=iEx4Vj7zBb6" >> .env.test
|
||||||
echo "PG_DB_NAME=tethys_dev" >> .env.test
|
echo "PG_DB_NAME=tethys_dev" >> .env.test
|
||||||
|
|
Loading…
Add table
Reference in a new issue