-
-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (37 loc) · 1.45 KB
/
sonarcloud.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
name: Sonarcloud Analysis
on:
schedule:
- cron: '21 9 * * 4'
push:
branches:
- 'master'
pull_request:
# Declare default permissions as read only.
permissions: read-all
jobs:
sonarcloud:
runs-on: ubuntu-latest
container: egecetinn/ubuntu2204
env:
BUILD_WRAPPER_OUT_DIR: build/sonar
steps:
- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: recursive
- name: Prepare
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install Test Requirements
run: pip install -r tests/data/requirements.txt
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@816b1822d71776ee0d32bc012e95024ec52ac1fc # v3.1.0
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DXXX_ENABLE_COVERAGE=ON
- name: Run build-wrapper
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug --parallel --target coverage-xml
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" --define sonar.coverageReportPaths=./build/coverage-xml-sonar.xml