-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.13 KB
/
Copy pathbuild.yml
File metadata and controls
45 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: SonarQube
on:
push:
branches:
- main
- master
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies (best effort)
continue-on-error: true
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then pip install . || true; fi
pip install coverage pytest || true
- name: Run tests with coverage (best effort)
continue-on-error: true
run: |
if [ -d tests ] || [ -d test ]; then
coverage run -m pytest || true
coverage xml -o coverage.xml || true
fi
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}