Skip to content

improved tests based on code report from solar scanner #5

improved tests based on code report from solar scanner

improved tests based on code report from solar scanner #5

Workflow file for this run

name: Sonar Scanner
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Install dependencies and run coverag
run: |
uv run coverage run --source=src/ngl -m pytest -v tests && uv run coverage report -m
uv run coverage xml
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}