diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fa82f8a9..554ed84f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,6 +199,7 @@ jobs: path: tests/integration/otel_spans_integration_testing_*.ndjson if-no-files-found: ignore - name: Upload coverage report + id: upload_coverage_report uses: actions/upload-artifact@v2 if: ${{ contains(fromJSON('["3.9"]'), matrix.python) && contains(fromJSON('["ubuntu-20.04"]'), matrix.os)}} with: @@ -213,15 +214,23 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Check coverage report existence + id: check_coverage_report + uses: andstor/file-existence-action@v3 + with: + files: "coverage.xml" - name: Download coverage report uses: actions/download-artifact@v2 + if: steps.check_coverage_report.outputs.files_exists == 'true' with: name: coverage-report # This is a workaround described in https://community.sonarsource.com/t/sonar-on-github-actions-with-python-coverage-source-issue/36057 - name: Override Coverage Source Path for Sonar + if: steps.check_coverage_report.outputs.files_exists == 'true' run: sed -i "s/\/home\/runner\/work\/synapsePythonClient<\/source>/\/github\/workspace<\/source>/g" coverage.xml - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master + if: ${{ always() }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}