Skip to content

Commit 3b718ec

Browse files
committed
Add sonar to project for quality checks
1 parent 65069f1 commit 3b718ec

File tree

6 files changed

+265
-10
lines changed

6 files changed

+265
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ jobs:
2222
Metrics:
2323
needs: [ CI ]
2424
uses: ./.github/workflows/report.yml
25+
secrets: inherit
2526
permissions:
2627
contents: read

.github/workflows/report.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Copy Artifacts into Root Folder
3030
working-directory: ./artifacts
3131
run: |
32-
poetry run -- coverage combine --keep coverage-python3.9*/.coverage
32+
poetry run -- coverage combine --keep coverage-python*/.coverage
3333
# Errors during copying are ignored because they are checked in the next step
3434
cp .coverage ../ || true
3535
cp lint-python3.9/.lint.txt ../ || true
@@ -42,6 +42,17 @@ jobs:
4242
- name: Generate Report
4343
run: poetry run -- nox -s project:report -- --format json | tee metrics.json
4444

45+
- name: Prepare files for sonar
46+
run: |
47+
poetry run -- coverage xml -o ci-coverage.xml --include="exasol/toolbox/*"
48+
49+
- name: Upload to sonar
50+
run: |
51+
poetry run -- pysonar --sonar-token ${{ secrets.SONAR_TOKEN }} \
52+
--sonar-python-coverage-report-paths ci-coverage.xml \
53+
--sonar-python-pylint-report-path .lint.json \
54+
--sonar-python-mypy-report-paths .security.json
55+
4556
- name: Upload Artifacts
4657
uses: actions/[email protected]
4758
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ odbcconfig/odbcinst.ini
77
.html-documentation
88

99
.coverage
10+
.sonar
1011

1112
_build/
1213

doc/changes/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pyupgrade_args = ("--py310-plus",)
1717
## ✨ Features
1818

1919
* [#441](https://github.com/exasol/python-toolbox/issues/441): Switched nox task for `version:check` to use the config value of `version_file` to specify the location of the `version.py`
20+
* [#451](https://github.com/exasol/python-toolbox/issues/451): Added Sonar to project for quality checks
2021

2122
## ⚒️ Refactorings
2223

0 commit comments

Comments
 (0)