-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.51 KB
/
build.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
34
35
36
37
38
39
40
41
42
43
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
sonarqube:
image: sonarqube:10.7.0-developer
ports:
- 9000:9000
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_logs:/opt/sonarqube/logs
- sonarqube_extensions:/opt/sonarqube/extensions
options: >-
--health-cmd "grep -Fq \"SonarQube is operational\" /opt/sonarqube/logs/sonar.log"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install build-wrapper
uses: sonarsource/sonarqube-scan-action/install-build-wrapper@antonio/SQCPPGHA-9-rebranding-and-forward
env:
SONAR_HOST_URL: http://localhost:9000 # SonarQube URL is stored in a GitHub secret
- name: Generate compilation database
run: |
mkdir build
cmake -S . -B build
- name: Install and run sonar-scanner
uses: sonarsource/sonarqube-scan-action@antonio/SQCPPGHA-9-rebranding-and-forward
env:
SONAR_HOST_URL: http://localhost:9000 # SonarQube URL is stored in a GitHub secret
with:
args: -Dsonar.login=admin -Dsonar.password=admin --debug --define sonar.cfamily.compile-commands=build/compile_commands.json