-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
32 lines (32 loc) · 1.46 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
jobs:
- job: BuildMacOSWithSonarQube
displayName: Build for macOS\CMake With SonarQube
pool:
vmImage: 'macos-latest'
variables:
SONARQUBE_HOST_URL: https://next.sonarqube.com/sonarqube
steps:
- task: SonarQubePrepare@5
inputs:
SonarQube: 'SonarQube' # Name of the SonarQube service endpoint you created
scannerMode: 'CLI'
configMode: 'file'
extraProperties:
"sonar.cfamily.compile-commands=build_wrapper_output_directory/compile_commands.json"
# if you are using using SonarQube 10.5 or earlier, replace "sonar.cfamily.compile-commands=build_wrapper_output_directory/compile_commands.json"
# with "sonar.cfamily.build-wrapper-output=build_wrapper_output_directory", as build-wrapper does not generate a compile_commands.json file before SonarQube 10.6
- bash: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip ${{variables.SONARQUBE_HOST_URL}}/static/cpp/build-wrapper-macosx-x86.zip
unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
displayName: Download and install build wrapper
- bash: |
mkdir build
cmake -S . -B build
export PATH=$HOME/.sonar/build-wrapper-macosx-x86:$PATH
build-wrapper-macosx-x86 --out-dir build_wrapper_output_directory cmake --build build/ --config Release
workingDirectory: .
displayName: Build in build-wrapper
- task: SonarQubeAnalyze@5
inputs:
jdkversion: 'JAVA_HOME_17_X64'