SCCPPGHA-15 Use unified sonarqube-scan-action (#12) #195
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Generate compilation database | |
run: | | |
mkdir build | |
cmake -S . -B build | |
- name: SonarQube Scan | |
uses: SonarSource/sonarqube-scan-action@v4 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} # Put the name of your token here | |
with: | |
# Set the property "sonar.cfamily.compile-commands" to the compilation database file | |
args: > | |
--define sonar.cfamily.compile-commands=build/compile_commands.json |