From dee2b60c3d95e8793cab110ccf88b47afd48915d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Nov 2022 11:59:54 +0000 Subject: [PATCH] Update sonarqube.yml --- .github/workflows/sonarqube.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index a5360c64f..227182028 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -8,8 +8,34 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }} cancel-in-progress: true jobs: + # This is a workaround for https://github.com/SonarSource/SonarJS/issues/578 + prepare: + name: Prepare + runs-on: ubuntu-latest + outputs: + reportPaths: ${{ steps.extraArgs.outputs.reportPaths }} + testExecutionReportPaths: ${{ steps.extraArgs.outputs.testExecutionReportPaths }} + steps: + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: coverage + path: coverage + + - id: extraArgs + run: | + coverage=$(find coverage -type f -name '*lcov.info' -printf "%p,") + echo "{reportPaths}={$coverage}" >> $GITHUB_OUTPUT + testResults=$(find coverage -type f -name '*test-result.xml' -printf "%p,") + echo "{testExecutionReportPaths}={$testResults}" >> $GITHUB_OUTPUT + sonarqube: name: 🩻 SonarQube + needs: prepare uses: matrix-org/matrix-js-sdk/.github/workflows/sonarcloud.yml@develop secrets: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + extraArgs: | + -Dsonar.javascript.lcov.reportPaths=${{ needs.prepare.outputs.reportPaths }} + -Dsonar.testExecutionReportPaths=${{ needs.prepare.outputs.testExecutionReportPaths }}