2023-08-04 11:51:18 +02:00
|
|
|
name: Test & Coverage
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
on:
|
2023-08-04 11:51:18 +02:00
|
|
|
# pull_request:
|
|
|
|
# paths-ignore:
|
|
|
|
# - frontend/**
|
|
|
|
# - website/**
|
|
|
|
schedule: # Run every day
|
|
|
|
- cron: '0 8 * * *'
|
|
|
|
workflow_dispatch:
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-26 12:10:57 +02:00
|
|
|
name: build (18.x) # temporary solution to trick branch protection rules
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
services:
|
|
|
|
# Label used to access the service container
|
|
|
|
postgres:
|
|
|
|
# Docker Hub image
|
|
|
|
image: postgres
|
|
|
|
# Provide the password for postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
2023-10-24 12:33:17 +02:00
|
|
|
POSTGRES_INITDB_ARGS: "--no-sync"
|
2021-10-06 12:31:28 +02:00
|
|
|
# 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:
|
2023-10-05 10:19:57 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-04-18 10:35:32 +02:00
|
|
|
- name: Use Node.js 18.x
|
2024-01-17 08:56:41 +01:00
|
|
|
uses: actions/setup-node@v4
|
2021-10-06 12:31:28 +02:00
|
|
|
with:
|
2023-10-26 09:09:03 +02:00
|
|
|
node-version: 18.x
|
2022-06-09 14:26:35 +02:00
|
|
|
cache: 'yarn'
|
2023-04-18 10:35:32 +02:00
|
|
|
- name: Tests on 18.x
|
2022-09-27 15:51:04 +02:00
|
|
|
id: coverage
|
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-02-02 22:18:50 +01:00
|
|
|
annotations: none
|
2021-10-06 12:31:28 +02:00
|
|
|
package-manager: yarn
|
2021-10-06 13:09:09 +02:00
|
|
|
test-script: yarn run test:coverage:jest
|
2022-05-20 11:16:44 +02:00
|
|
|
base-coverage-file: ./coverage/report.json
|
2022-09-27 15:51:04 +02:00
|
|
|
output: report-markdown
|
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
|
2022-09-27 15:51:04 +02:00
|
|
|
# - name: Report coverage on ${{ matrix.node-version }}
|
|
|
|
# uses: marocchino/sticky-pull-request-comment@v2
|
|
|
|
# with:
|
|
|
|
# # pass output from the previous step by id.
|
|
|
|
# message: ${{ steps.coverage.outputs.report }}
|