From b7bdbaba01a50df04606cf44a88cc83c623b89c0 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Tue, 9 Nov 2021 15:02:36 +0100 Subject: [PATCH] SONAR-15430 Fix C-family tutorial for GH Actions on linux --- .../tutorials/github-action/commands/CFamily.tsx | 13 ++++++++++--- .../__tests__/__snapshots__/CFamily-test.tsx.snap | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx index e10317533f4..552067f30e0 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx @@ -48,10 +48,17 @@ const STEPS = { env: SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} + - name: Download and install the SonarScanner + env: + SONAR_SCANNER_VERSION: 4.6.2.2472 + run: | + curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip + unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + echo "$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH + - name: SonarQube analysis - uses: SonarSource/sonarqube-scan-action@v1.0.0 - with: - args: -Dsonar.cfamily.build-wrapper-output=bw-output + run: | + sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output env: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}`, diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap index 38c323434e5..112dd555078 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap @@ -117,10 +117,17 @@ jobs: env: SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} + - name: Download and install the SonarScanner + env: + SONAR_SCANNER_VERSION: 4.6.2.2472 + run: | + curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip + unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + echo \\"$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin\\" >> $GITHUB_PATH + - name: SonarQube analysis - uses: SonarSource/sonarqube-scan-action@v1.0.0 - with: - args: -Dsonar.cfamily.build-wrapper-output=bw-output + run: | + sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output env: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} -- 2.39.5