-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
33 lines (33 loc) · 1.49 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
33
jobs:
- job: BuildLinuxWithSonarQube
displayName: Build for Linux\CMake With SonarQube
pool:
vmImage: 'ubuntu-latest'
variables:
SONARQUBE_HOST_URL: https://next.sonarqube.com/sonarqube
steps:
# Make Build Wrapper available
- 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-linux-x86.zip ${{variables.SONARQUBE_HOST_URL}}/static/cpp/build-wrapper-linux-x86.zip
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
displayName: Download and install build wrapper
- bash: |
mkdir build
cmake -S . -B build
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
build-wrapper-linux-x86-64 --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'