Skip to content

Commit cacd5b3

Browse files
authored
Merge pull request #60 from TUDelftGeodesy/fix_sonarcloud
update sonarcloud git workflow
2 parents 5638de8 + 4920cb7 commit cacd5b3

File tree

3 files changed

+15
-36
lines changed

3 files changed

+15
-36
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
1-
name: sonarcloud
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
10-
1+
name: Build
2+
on: [pull_request]
113
jobs:
12-
13-
sonarcloud:
14-
name: SonarCloud
4+
sonarqube:
5+
name: SonarQube
156
runs-on: ubuntu-latest
167
steps:
17-
- uses: actions/checkout@v3
8+
- uses: actions/checkout@v4
189
with:
1910
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
11+
- name: SonarQube Scan
12+
uses: SonarSource/sonarqube-scan-action@v4
3413
env:
35-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
36-
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
15+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7717027.svg)](https://doi.org/10.5281/zenodo.7717027)
44
[![PyPI](https://img.shields.io/pypi/v/sarxarray.svg?colorB=blue)](https://pypi.python.org/project/sarxarray/)
5-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MotionbyLearning_sarxarray&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=MotionbyLearning_sarxarray)
5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TUDelftGeodesy_sarxarray&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TUDelftGeodesy_sarxarray)
66
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7980/badge)](https://www.bestpractices.dev/projects/7980)
77
[![Build](https://github.com/TUDelftGeodesy/sarxarray/actions/workflows/build.yml/badge.svg)](https://github.com/TUDelftGeodesy/sarxarray/actions/workflows/build.yml)
88
[![License](https://img.shields.io/github/license/TUDelftGeodesy/sarxarray)](https://opensource.org/licenses/Apache-2.0)

sonar-project.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
sonar.organization=motionbylearning
2-
sonar.projectKey=MotionbyLearning_sarxarray
1+
sonar.organization=tudelftgeodesy
2+
sonar.projectKey=TUDelftGeodesy_sarxarray
33
sonar.host.url=https://sonarcloud.io
44
sonar.sources=sarxarray/
55
sonar.tests=tests/
6-
sonar.links.homepage=https://github.com/MotionbyLearning/sarxarray
7-
sonar.links.issue=https://github.com/MotionbyLearning/sarxarray/issues
8-
sonar.links.ci=https://github.com/MotionbyLearning/sarxarray/actions
6+
sonar.links.homepage=https://github.com/TUDelftGeodesy/sarxarray
7+
sonar.links.issue=https://github.com/TUDelftGeodesy/sarxarray/issues
8+
sonar.links.ci=https://github.com/TUDelftGeodesy/sarxarray/actions
99
sonar.python.coverage.reportPaths=coverage.xml
1010
sonar.python.xunit.reportPath=xunit-result.xml
1111
sonar.python.pylint.reportPaths=pylint-report.txt

0 commit comments

Comments
 (0)