Skip to content

Commit

Permalink
Merge pull request #60 from TUDelftGeodesy/fix_sonarcloud
Browse files Browse the repository at this point in the history
update sonarcloud git workflow
  • Loading branch information
rogerkuou authored Dec 13, 2024
2 parents 5638de8 + 4920cb7 commit cacd5b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
39 changes: 9 additions & 30 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
name: sonarcloud

on:
push:
branches:
- main
pull_request:
branches:
- main

name: Build
on: [pull_request]
jobs:

sonarcloud:
name: SonarCloud
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Run unit tests with coverage
run: pytest --cov --cov-report term --cov-report xml
- name: Correct coverage paths
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7717027.svg)](https://doi.org/10.5281/zenodo.7717027)
[![PyPI](https://img.shields.io/pypi/v/sarxarray.svg?colorB=blue)](https://pypi.python.org/project/sarxarray/)
[![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)
[![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)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7980/badge)](https://www.bestpractices.dev/projects/7980)
[![Build](https://github.com/TUDelftGeodesy/sarxarray/actions/workflows/build.yml/badge.svg)](https://github.com/TUDelftGeodesy/sarxarray/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/TUDelftGeodesy/sarxarray)](https://opensource.org/licenses/Apache-2.0)
Expand Down
10 changes: 5 additions & 5 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sonar.organization=motionbylearning
sonar.projectKey=MotionbyLearning_sarxarray
sonar.organization=tudelftgeodesy
sonar.projectKey=TUDelftGeodesy_sarxarray
sonar.host.url=https://sonarcloud.io
sonar.sources=sarxarray/
sonar.tests=tests/
sonar.links.homepage=https://github.com/MotionbyLearning/sarxarray
sonar.links.issue=https://github.com/MotionbyLearning/sarxarray/issues
sonar.links.ci=https://github.com/MotionbyLearning/sarxarray/actions
sonar.links.homepage=https://github.com/TUDelftGeodesy/sarxarray
sonar.links.issue=https://github.com/TUDelftGeodesy/sarxarray/issues
sonar.links.ci=https://github.com/TUDelftGeodesy/sarxarray/actions
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.xunit.reportPath=xunit-result.xml
sonar.python.pylint.reportPaths=pylint-report.txt
Expand Down

0 comments on commit cacd5b3

Please sign in to comment.