-
Notifications
You must be signed in to change notification settings - Fork 97
65 lines (64 loc) · 2.06 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
on:
push:
branches:
- master
- staging
pull_request:
types: [opened, synchronize, reopened]
name: SonarCloud
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_AUTO }}
with:
args: >
-Dsonar.organization=swift-nav
-Dsonar.projectKey=swift-nav_libsbp_auto
-Dsonar.sources=.
-Dsonar.exclusions=java/**
-Dsonar.verbose=true
-Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=-
C:
name: C Code Coverage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Setup
run: |
sudo apt-get install llvm -y
- name: Build and Run Tests
env:
CC: clang
CXX: clang++
run: |
cmake -S c -B build -DCODE_COVERAGE=ON -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage &&
build-wrapper-linux-x86-64 --out-dir ./bw-output cmake --build build -j4 --target ccov-all-export
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_C }}
run: sonar-scanner
-X
-Dsonar.organization=swift-nav
-Dsonar.projectName=libsbp-c
-Dsonar.projectKey=swift-nav_libsbp_c
-Dsonar.verbose=true
-Dsonar.login=${{ secrets.SONAR_TOKEN_C }}
-Dsonar.cfamily.threads=4
-Dsonar.cfamily.llvm-cov.reportPath=./build/ccov/coverage.txt
-Dsonar.sources=c/src/,c/include/
-Dsonar.tests=c/test/
-Dsonar.cfamily.build-wrapper-output=./bw-output