Skip to content

Feature/setup sonarqube #30

Feature/setup sonarqube

Feature/setup sonarqube #30

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']
node_version: [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 build
- run: pnpm run test:coverage
- run: ls -lah
- 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 }}