Adding npm ci, fixing minor issues
This commit is contained in:
39
.github/workflows/postgres-service.yml
vendored
39
.github/workflows/postgres-service.yml
vendored
@@ -1,7 +1,15 @@
|
|||||||
on: [push]
|
name: Postgres Service Example
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
container-job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
container:
|
container:
|
||||||
@@ -30,3 +38,30 @@ jobs:
|
|||||||
# If we were running the job on the VM this would be localhost
|
# If we were running the job on the VM this would be localhost
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
|
|
||||||
|
vm-job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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: localhost
|
||||||
|
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
10
.github/workflows/redis-service.yml
vendored
10
.github/workflows/redis-service.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
name: Redis Service Example
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -21,6 +23,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
working-directory: ./redis
|
||||||
|
|
||||||
- run: node client.js
|
- run: node client.js
|
||||||
env:
|
env:
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
@@ -37,6 +43,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
working-directory: ./redis
|
||||||
|
|
||||||
- run: node client.js
|
- run: node client.js
|
||||||
working-directory: ./redis
|
working-directory: ./redis
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user