2020-11-24 10:22:27 +01:00
|
|
|
name: Build & Tests
|
|
|
|
|
2020-12-21 15:58:07 +01:00
|
|
|
on:
|
2021-01-06 13:56:44 +01:00
|
|
|
push:
|
2021-03-04 14:27:43 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2021-06-04 15:33:47 +02:00
|
|
|
paths-ignore:
|
2021-10-25 18:54:46 +02:00
|
|
|
- website/**
|
2021-03-04 14:27:43 +01:00
|
|
|
|
2020-11-24 10:22:27 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-11 12:58:05 +02:00
|
|
|
node-version: [14.x, 16.x]
|
2020-11-24 10:22:27 +01:00
|
|
|
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
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2021-09-27 19:21:13 +02:00
|
|
|
uses: actions/setup-node@v2
|
2020-11-24 10:22:27 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- run: yarn
|
2021-02-04 11:02:58 +01:00
|
|
|
- run: yarn lint
|
2020-11-24 10:22:27 +01:00
|
|
|
- run: yarn run test:coverage
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
|
|
|
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
|
|
|
|
- name: Coveralls
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|