chore: use tap reporter by default for mocha and transform the result… #99
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
name: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
unit-tests: | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
- 'windows-latest' | |
- 'macos-latest' | |
node_version: | |
- 'lts/*' | |
fail-fast: false | |
max-parallel: 1 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
run_install: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: 'pnpm' | |
- run: pnpm install -D tap-junit | |
- run: pnpm run test:coverage | tap-junit > coverage/junit.xml | |
- name: SonarQube Scan | |
if: matrix.os == 'ubuntu-latest' | |
uses: SonarSource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Codecov Scan | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/junit.xml,!./cache | |
fail_ci_if_error: true |