#34 force fail check reuse #131
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2024 Marcellino Palerme <[email protected]> | |
# | |
# SPDX-License-Identifier: MIT | |
name: Tests Unit | |
on: | |
push: | |
branches: '*' | |
permissions: | |
contents: read | |
pull-requests: write | |
checks: write | |
env: | |
PGPASSWORD: ep2m2 | |
PGUSER: ep2m2 | |
PGPORT: 5432 | |
PGDATABASE: ep2m2db | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
service-p2m2tool-api: | |
image: inraep2m2/service-p2m2tools-api | |
ports: | |
- 8080:8080 | |
db: | |
image: postgres:latest | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: ep2m2 | |
POSTGRES_DB: ep2m2db | |
POSTGRES_USER: ep2m2 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Get repo | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: 'npm' | |
- name: Installation project s packages | |
run: npm ci | |
- name: Configure database | |
run: node ./db/init.js | |
- name: Test | |
run: npm run test | |
- name: Coverage | |
if: always() | |
run: npm run coverage | |
- name: Report coverage | |
if: always() | |
uses: davelosert/vitest-coverage-report-action@v2 | |
with: | |
file-coverage-mode: all | |
- name: Summary Tests | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
./test/**/*.xml | |
- name: Complet report tests | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
reporter: "java-junit" | |
name: Test Unit | |
path: ./test/**/*.xml |