Skip to content

Commit

Permalink
Merge pull request #83 from TUDelftGeodesy/configure_sonarcloud
Browse files Browse the repository at this point in the history
Configure sonarcloud
  • Loading branch information
rogerkuou authored Dec 23, 2024
2 parents b2c6923 + f297554 commit 4b9dfa8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 37 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,15 @@ on:
- main

jobs:

sonarcloud:
name: SonarCloud
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
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 ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- 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 @@ -3,7 +3,7 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7717084.svg)](https://doi.org/10.5281/zenodo.7717084)
[![PyPI](https://img.shields.io/pypi/v/stmtools.svg?colorB=blue)](https://pypi.python.org/project/stmtools/)
[![Build](https://github.com/TUDelftGeodesy/stmtools/actions/workflows/build.yml/badge.svg)](https://github.com/TUDelftGeodesy/stmtools/actions/workflows/build.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MotionbyLearning_stmtools&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=MotionbyLearning_stmtools)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TUDelftGeodesy_stmtools&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TUDelftGeodesy_stmtools)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8027/badge?)](https://www.bestpractices.dev/projects/8027)
[![License](https://img.shields.io/github/license/TUDelftGeodesy/stmtools)](https://opensource.org/licenses/Apache-2.0)

Expand Down
14 changes: 2 additions & 12 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
sonar.organization=motionbylearning
sonar.projectKey=MotionbyLearning_stmtools
sonar.host.url=https://sonarcloud.io
sonar.sources=stmtools/
sonar.tests=tests/
sonar.links.homepage=https://github.com/MotionbyLearning/stmtools
sonar.links.issue=https://github.com/MotionbyLearning/stmtools/issues
sonar.links.ci=https://github.com/MotionbyLearning/stmtools/actions
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.xunit.reportPath=xunit-result.xml
sonar.python.pylint.reportPaths=pylint-report.txt
sonar.python.version= 3.10, 3.11
sonar.projectKey=TUDelftGeodesy_stmtools
sonar.organization=tudelftgeodesy

0 comments on commit 4b9dfa8

Please sign in to comment.