Skip to content

Commit

Permalink
cicd: move sonar scanner download to correct workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazrius committed Jul 9, 2023
1 parent ac46c88 commit 67af3be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/sonar-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 67af3be

Please sign in to comment.