Use released version #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# Trigger analysis when pushing in master or pull requests, and when creating | |
# a pull request. | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
name: Main Workflow | |
jobs: | |
sonarqube: | |
runs-on: windows-latest | |
env: | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Set up msbuild | |
uses: microsoft/[email protected] | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarqube-github-c-cpp@v1 | |
env: | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
- name: Run build-wrapper | |
run: build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} msbuild sonar_scanner_example.vcxproj /t:rebuild /nodeReuse:false | |
#here goes your compilation wrapped with build-wrapper; See https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/c-family/#using-build-wrapper for more information | |
# build-preparation steps | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" #Consult https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options |