File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : SonarQube
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - master
8+ - develop
9+ pull_request :
10+ types : [opened, synchronize, reopened]
11+
12+ jobs :
13+ sonarqube :
14+ name : SonarQube Scan
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : ' 3.x'
25+
26+ - name : Install dependencies (best effort)
27+ continue-on-error : true
28+ run : |
29+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+ if [ -f pyproject.toml ]; then pip install . || true; fi
31+ pip install coverage pytest || true
32+
33+ - name : Run tests with coverage (best effort)
34+ continue-on-error : true
35+ run : |
36+ if [ -d tests ] || [ -d test ]; then
37+ coverage run -m pytest || true
38+ coverage xml -o coverage.xml || true
39+ fi
40+
41+ - name : SonarQube Scan
42+ uses : SonarSource/sonarqube-scan-action@v5
43+ env :
44+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
45+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
You can’t perform that action at this time.
0 commit comments