Skip to content

Commit

Permalink
add sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Jun 14, 2021
1 parent 1e92dc1 commit 69412e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[run]
source = "sme_contrib"
omit = "sme_contrib/tests/*"
branch = True
concurrency = "multiprocessing"
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -24,3 +26,11 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
verbose: true
# https://stackoverflow.com/questions/12844451/test-test-coverage-with-python-in-sonar-not-showing-up
- run: sed -i 's/\/home\/runner\/work\/sme_contrib\/sme_contrib\///g' coverage.xml
if: matrix.os == 'ubuntu-18.04' && matrix.python-version == 3.9
- uses: sonarsource/sonarcloud-github-action@master
if: matrix.os == 'ubuntu-18.04' && matrix.python-version == 3.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5 changes: 5 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sonar.projectKey=spatial-model-editor_sme_contrib
sonar.organization=spatial-model-editor
sonar.sources=sme_contrib
sonar.exclusions=sme_contrib/tests/**/*
sonar.python.coverage.reportPaths=coverage.xml

0 comments on commit 69412e9

Please sign in to comment.