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 }}