diff --git a/.github/workflows/sonar-build.yml b/.github/workflows/sonar-build.yml index aee326159..7ebbab2fa 100644 --- a/.github/workflows/sonar-build.yml +++ b/.github/workflows/sonar-build.yml @@ -38,14 +38,6 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Download and set up sonar-scanner - env: - SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-windows.zip - run: | - New-Item -Force -ItemType directory -Path $HOME\.sonar - curl -sSLo $HOME\.sonar\sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} - unzip -o $HOME\.sonar\sonar-scanner.zip -d $HOME\.sonar\ - echo "$HOME\.sonar\sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-windows\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Download and set up build-wrapper env: BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-win-x86.zip diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 7bd7b34c1..aa8f75b3c 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -44,6 +44,21 @@ jobs: fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/sonar-build.zip`, Buffer.from(download.data)); - name: 'Unzip Sonar Build' run: Expand-Archive -Force sonar-build.zip ${{ env.BUILD_WRAPPER_OUT_DIR }} + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Download and set up sonar-scanner + env: + SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-windows.zip + run: | + New-Item -Force -ItemType directory -Path $HOME\.sonar + curl -sSLo $HOME\.sonar\sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} + unzip -o $HOME\.sonar\sonar-scanner.zip -d $HOME\.sonar\ + echo "$HOME\.sonar\sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-windows\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}