Skip to content

Merge pull request #79 from Judahh:development #148

Merge pull request #79 from Judahh:development

Merge pull request #79 from Judahh:development #148

Workflow file for this run

name: Test
on:
pull_request:
branches:
- "*" # matches every branch
- "*/*" # matches every branch containing a single '/'
push:
branches:
- master
- main
# - devel
# - develop
# - development
jobs:
build:
runs-on: ubuntu-latest
# runs all of the steps inside the specified container rather than on the VM host.
# Because of this the network configuration changes from host based network to a container network.
container:
image: node:latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_PORT: 5432
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
mongo:
image: mongo:latest
ports:
- 27017:27017
strategy:
matrix:
node-version: [18.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@main
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
- name: Checkout
uses: actions/checkout@main
- name: BUILD
uses: judahh/nodeBuild@main
with:
node_version: ${{ matrix.node-version }}
- name: TEST
uses: judahh/yarnTest@main
env:
# use postgres for the host here because we have specified a container 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] }}
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
MONGO_HOST: mongo
MONGO_PORT: ${{ job.services.mongo.ports[27017] }}
- name: ZIP TO ARTIFACT
if: ${{ github.ref_name == 'main' || github.ref_name == 'master' }}
uses: judahh/zipToArtifact@main
with:
production: true