From cf7c2d58864e5a25f74e21effc6192c388c46a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Flis?= Date: Sat, 6 Jun 2026 14:00:18 +0200 Subject: [PATCH 1/2] ci: replace Codecov with SonarCloud coverage - add .github/workflows/sonar.yml running tests with coverage and SonarCloud scan (fork guard, fetch-depth 0) - drop Codecov upload step from run_tests.yml - add sonar-project.properties (org BKDDFS, key BKDDFS_PerfectFrameAI) - swap Codecov badge for SonarCloud coverage badge in README --- .github/workflows/run_tests.yml | 6 ------ .github/workflows/sonar.yml | 37 +++++++++++++++++++++++++++++++++ README.md | 4 ++-- sonar-project.properties | 12 +++++++++++ 4 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/sonar.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 599aa57..3a579db 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -32,12 +32,6 @@ jobs: - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Run tests with coverage run: uv run --group test pytest --cov=perfectframe --cov-report=xml --cov-fail-under=100 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - fail_ci_if_error: true test-docker: needs: pre-commit diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..b928f0e --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,37 @@ +name: SonarCloud + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + pull-requests: read + +jobs: + sonar: + name: SonarCloud Analysis + if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + + - name: Set up Python 3.13 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + with: + python-version: "3.13" + + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + + - name: Run tests with coverage + run: uv run --group test pytest --cov=perfectframe --cov-report=xml + + - name: SonarCloud Scan + uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8.1.0 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/README.md b/README.md index 2873cd3..0c1a5f5 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@

Github Created At GitHub last commit - - + + GitHub Tag shamefile diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..593360a --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.organization=BKDDFS +sonar.projectKey=BKDDFS_PerfectFrameAI +sonar.projectName=PerfectFrameAI + +sonar.sources=perfectframe +sonar.tests=tests + +sonar.exclusions=**/tests/**,**/__pycache__/** +sonar.cpd.exclusions=**/tests/** + +sonar.python.version=3.13 +sonar.python.coverage.reportPaths=coverage.xml From b9dc5c47f99ed2f7020699ab655531d6abddf442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Flis?= Date: Sat, 6 Jun 2026 14:09:10 +0200 Subject: [PATCH 2/2] fix(ci): correct SonarCloud organization slug to bkddfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Org slug is lowercase 'bkddfs' (per prior SonarCloud setup), not 'BKDDFS' — wrong casing caused HTTP 403 from api.sonarcloud.io. --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 593360a..b3c3115 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -sonar.organization=BKDDFS +sonar.organization=bkddfs sonar.projectKey=BKDDFS_PerfectFrameAI sonar.projectName=PerfectFrameAI