Skip to content

Unit Tests

Unit Tests #61

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
unit-tests:
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'windows-latest'
- 'macos-latest'
node_version:
- '>=18.0.0'
- 'lts/*'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Shallow clones should be disabled for a better relevancy of sonarqube analysis
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9.5.0
run_install: true
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- run: pnpm run test:coverage
- name: SonarCloud Scan
if: matrix.os == 'ubuntu-latest'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}