Skip to content

TESTING CODE CLIMATE COVERAGE - NO MERGE #3

TESTING CODE CLIMATE COVERAGE - NO MERGE

TESTING CODE CLIMATE COVERAGE - NO MERGE #3

name: APP (React 18)
on:
push:
branches: [dev]
paths:
- 'frontend/**' # Triggers on changes to files in the frontend/ directory.
- '!frontend/cypress/**' # Will not trigger on changes to the following.
- '!frontend/cypress.config.*'
- '!frontend/.eslintrc.*'
- '!frontend/.prettierrc.*'
- '!frontend/Dockerfile*'
- '!frontend/nginx.conf'
- '!frontend/vite.config.*'
pull_request:
types: [opened, synchronize] # Triggered by opened or changed pull requests.
branches: [dev]
paths:
- 'frontend/**' # Triggers on changes to files in the frontend/ directory.
- '!frontend/cypress/**' # Will not trigger on changes to the following.
- '!frontend/cypress.config.*'
- '!frontend/.eslintrc.*'
- '!frontend/.prettierrc.*'
- '!frontend/Dockerfile*'
- '!frontend/nginx.conf'
- '!frontend/vite.config.*'
- '.github/workflows/app-codecov-test.yml'
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
working-directory: ./frontend
codeCov-token: ${{ secrets.CodeCov }}
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i
working-directory: ${{env.working-directory}}
# - run: npm run build --if-present
# working-directory: ${{env.working-directory}}
- run: npm run coverage
working-directory: ${{env.working-directory}}
- name: Codecov
uses: codecov/codecov-action@v3
with:
# User defined upload name. Visible in Codecov UI
name: PIMS
# Repository upload token - get it from codecov.io. Required only for private repositories
token: ${{env.codeCov-token}}
# Path to coverage file to upload
file: ${{env.working-directory}}/coverage/coverage-final.json
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
flags: unittests
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
env_vars: javascript
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true