2021-10-06 22:16:58 +02:00
|
|
|
name: PR -> Test & Coverage
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
on:
|
2022-05-20 11:38:54 +02:00
|
|
|
pull_request:
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [14.x]
|
|
|
|
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: >-
|
2022-06-09 14:26:35 +02:00
|
|
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
2022-07-01 13:51:26 +02:00
|
|
|
|
2021-10-06 12:31:28 +02:00
|
|
|
steps:
|
2022-04-06 21:43:00 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-10-06 12:31:28 +02:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-04-06 21:43:29 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-10-06 12:31:28 +02:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-06-09 14:26:35 +02:00
|
|
|
cache: 'yarn'
|
2022-08-24 16:00:13 +02:00
|
|
|
- run: yarn install --frozen-lockfile --ignore-scripts
|
2022-08-25 11:20:47 +02:00
|
|
|
- run: cd frontend && yarn install --frozen-lockfile
|
2021-10-06 12:31:28 +02:00
|
|
|
- name: Tests on ${{ matrix.node-version }}
|
2022-02-02 22:18:50 +01:00
|
|
|
uses: ArtiomTr/jest-coverage-report-action@v2
|
2021-10-06 12:31:28 +02:00
|
|
|
with:
|
2022-08-24 15:50:52 +02:00
|
|
|
skip-step: install
|
2022-02-02 22:18:50 +01:00
|
|
|
annotations: none
|
2021-10-06 12:31:28 +02:00
|
|
|
package-manager: yarn
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-08-24 16:00:13 +02:00
|
|
|
test-script: yarn run test:coverage:jest
|
2022-05-20 11:16:44 +02:00
|
|
|
base-coverage-file: ./coverage/report.json
|
2021-10-06 12:31:28 +02:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
|
|
|
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
|
2021-10-06 12:41:50 +02:00
|
|
|
NODE_ENV: test
|
|
|
|
PORT: 4243
|