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