Skip to content

fix/semantic release #73

fix/semantic release

fix/semantic release #73

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: API CI for New Pull Requests
on:
pull_request:
branches:
- main
env:
project-directory: ./
jobs:
test:
name: Run all tests
runs-on: ubuntu-latest
container: node:10.18-jessie
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: npm clean install
run: npm ci
working-directory: ${{ env.project-directory }}
- name: run ESLint
run: npm run lint
working-directory: ${{ env.project-directory }}
- name: run migrate
run: npm run migrate
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
- name: run seed
run: npm run seed
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
DATABASE_URL_SEEDER: postgresql://postgres:postgres@postgres/postgres
- name: run unit tests
run: npm run test-unit-ci
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
CI: true
- name: run integration tests
run: npm run test-integration-ci
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
DATABASE_URL_SEEDER: postgresql://postgres:postgres@postgres/postgres
CI: true
- name: run repository tests
run: npm run test-repository-ci
working-directory: ${{ env.project-directory }}
env:
DATABASE_URL: postgresql://postgres:postgres@postgres/postgres
CI: true