Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5
with:
# SonarQube reads git history to attribute issues to authors.
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v7
Expand Down Expand Up @@ -47,3 +50,13 @@ jobs:
title: Coverage Report
create-new-comment: false
hide-report: false


# coverage.xml is written by the pytest step above. Fork PRs get no secrets,
# so the scan could only fail on a missing token -- skip rather than fail red.
- name: SonarQube analysis
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2.1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=automation
sonar.projectName=automation

# tests/ is top level, so sources and tests are already disjoint -- SonarQube aborts if a
# file is reachable from both.
sonar.sources=openhands
sonar.tests=tests

# Written by tests.yml as --cov-report=xml:coverage.xml, in the same job as the scan, so
# the report always matches the analysed commit.
sonar.python.coverage.reportPaths=coverage.xml

sonar.python.version=3.12
sonar.sourceEncoding=UTF-8
Loading