38 lines
1004 B
YAML
38 lines
1004 B
YAML
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
image: node:10.16-jessie
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:10.8
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: postgres
|
|
ports:
|
|
- 5432:5432
|
|
# needed because the postgres container does not provide a healthcheck
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- run: npm ci
|
|
working-directory: ./postgres
|
|
- run: node client.js
|
|
working-directory: ./postgres
|
|
env:
|
|
# use postgres for the host here because we have specified a contaienr for the job.
|
|
# If we were running the job on the VM this would be localhost
|
|
POSTGRES_HOST: postgres
|
|
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|