2021-10-06 22:16:58 +02:00
|
|
|
name: PR -> Test & Coverage
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
on:
|
2022-09-26 12:53:20 +02:00
|
|
|
pull_request:
|
2021-10-06 12:31:28 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-18 10:35:32 +02:00
|
|
|
name: build (14.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
|
|
|
|
# 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
|
2023-04-18 10:35:32 +02:00
|
|
|
- name: Use Node.js 18.x
|
2022-04-06 21:43:29 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-10-06 12:31:28 +02:00
|
|
|
with:
|
2023-04-18 10:35:32 +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 }}
|