Skip to content

Commit 30af9cc

Browse files
committed
update sonarcloud git workflow
1 parent 5638de8 commit 30af9cc

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
1-
name: sonarcloud
2-
1+
name: Build
32
on:
43
push:
54
branches:
6-
- main
5+
- main
76
pull_request:
8-
branches:
9-
- main
10-
7+
types: [opened, synchronize, reopened]
118
jobs:
12-
13-
sonarcloud:
14-
name: SonarCloud
9+
sonarqube:
10+
name: SonarQube
1511
runs-on: ubuntu-latest
1612
steps:
17-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1814
with:
1915
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20-
- name: Set up Python
21-
uses: actions/setup-python@v3
22-
with:
23-
python-version: "3.10"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install .[dev]
28-
- name: Run unit tests with coverage
29-
run: pytest --cov --cov-report term --cov-report xml
30-
- name: Correct coverage paths
31-
run: sed -i "s+$PWD/++g" coverage.xml
32-
- name: SonarCloud Scan
33-
uses: SonarSource/sonarcloud-github-action@master
16+
- name: SonarQube Scan
17+
uses: SonarSource/sonarqube-scan-action@v4
3418
env:
35-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
36-
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
20+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)