Pass coverage.xml to sonar analysis.

Since the code doesn't contain any version specific stuff, we don't need
to combine coverage output files (thank $diety).
This commit is contained in:
Dave Shawley 2021-04-07 07:27:30 -04:00
parent 396f667598
commit 40708fa70c
No known key found for this signature in database
GPG key ID: F41A8A99298F8EED

View file

@ -8,6 +8,7 @@ on:
jobs: jobs:
test: test:
name: Tests and style checks
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@ -34,21 +35,32 @@ jobs:
coverage run -m unittest coverage run -m unittest
coverage report coverage report
coverage xml -o ./coverage.xml coverage xml -o ./coverage.xml
- name: Upload coverage - name: Send coverage to codecov.io
uses: codecov/codecov-action@v1.3.2 uses: codecov/codecov-action@v1.3.2
with: with:
token: ${{secrets.CODECOV_TOKEN}} token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml file: ./coverage.xml
flags: unittests flags: unittests
fail_ci_if_error: true fail_ci_if_error: true
verbose: true - name: Save coverage report
if: ${{ matrix.python-version == "3.9" }}
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: ./coverage.xml
sonarcloud: sonarcloud:
name: SonarCloud name: SonarCloud
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ secrets.SONAR_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Download coverage report
uses: actions/download-artifact@v2
with:
name: coverage.xml
- name: SonarCloud Scan - name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master uses: SonarSource/sonarcloud-github-action@master
env: env: