Skip to content

SonarCloud coverage 3 #3

SonarCloud coverage 3

SonarCloud coverage 3 #3

Workflow file for this run

name: SonarCloud
on:
push:
branches: [ main, master ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv and dependencies
run: |
pip install uv
uv sync --frozen
uv pip install --system pytest pytest-cov pytest-django
- name: Run tests with coverage
env:
DJANGO_SETTINGS_MODULE: task_manager.settings
run: |
mkdir -p reports
pytest --ds=task_manager.settings --cov=task_manager --cov-report=xml:coverage.xml --junitxml=reports/junit.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}