From 40708fa70c4eaa4641a598a09a866697ff6eeace Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Wed, 7 Apr 2021 07:27:30 -0400 Subject: [PATCH] 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). --- .github/workflows/run-tests.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7c6d983..b94d560 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,6 +8,7 @@ on: jobs: test: + name: Tests and style checks runs-on: ubuntu-latest strategy: matrix: @@ -34,21 +35,32 @@ jobs: coverage run -m unittest coverage report coverage xml -o ./coverage.xml - - name: Upload coverage + - name: Send coverage to codecov.io uses: codecov/codecov-action@v1.3.2 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage.xml flags: unittests 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: name: SonarCloud runs-on: ubuntu-latest + if: ${{ secrets.SONAR_TOKEN }} steps: - uses: actions/checkout@v2 with: 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 uses: SonarSource/sonarcloud-github-action@master env: