From e70360a8d64b29aa0ea6920a4aed45db2327f0ac Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Fri, 17 Apr 2026 18:03:16 +0000 Subject: [PATCH] chore(ci): enable SonarQube (#441) Reviewed-on: https://git.tainton.uk/repos/roboluke/pulls/441 --- .gitea/workflows/ci.yml | 13 +++++++------ sonar-project.properties | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b0e7e42..2e80841 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -53,16 +53,17 @@ jobs: run: | uv run coverage run -m pytest -v --junitxml=testresults.xml uv run coverage report - # sed -i 's@${{ gitea.workspace }}@/github/workspace@g' coverage.xml + uv run coverage xml -q -o coverage.xml + sed -i 's@${{ gitea.workspace }}@/github/workspace@g' coverage.xml - name: Minimize uv cache run: uv cache prune --ci - # - name: SonarQube Scan - # uses: SonarSource/sonarqube-scan-action@v5.2.0 - # env: - # SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }} - # SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v7.1.0 + env: + SONAR_HOST_URL: ${{ vars.SONAR_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # - name: Set up environment for Snyk # run: | diff --git a/sonar-project.properties b/sonar-project.properties index 2013b30..80bedcb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,10 +1,10 @@ sonar.projectKey=roboluke sonar.projectName=roboluke -sonar.python.version=3.13 +sonar.python.version=3.14 sonar.python.coverage.reportPaths=coverage.xml sonar.python.pylint.reportPaths=lintreport.txt sonar.python.xunit.reportPath=testresults.xml sonar.docker.hadolint.reportPaths=hadolint.out sonar.sources=Dockerfile,app sonar.tests=tests -sonar.exclusions=,.github/**,.gitignore,CODEOWNERS,CHANGELOG.md,LICENSE.md,README.md,renovate.json,requirements-dev.txt,requirements.txt +sonar.exclusions=.archive/**,.github/**,.gitea/**,.gitignore,CODEOWNERS,CHANGELOG.md,LICENSE.md,README.md,renovate.json,requirements-dev.txt,requirements.txt