-
Notifications
You must be signed in to change notification settings - Fork 82
65 lines (62 loc) · 2.32 KB
/
sonar.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
name: Sonar
on:
pull_request:
branches:
- master
push:
branches:
- master
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
jobs:
sonar_gcc_meson:
name: sonar, gcc and meson
runs-on: ubuntu-24.04
environment: SONAR
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update package list
run: sudo apt-get update
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- name: Install gcc compiler, meson and ninja
run: sudo apt-get -y install gcc g++ libtbb-dev ccache libtool pkg-config
- name: Install meson, ninja, lcov and gcovr via pip
run: pip install --user meson ninja lcov gcovr --break-system-packages
- name: Install libosmscout dependencies
run: "sudo apt-get install -y
catch2
libxml2-dev
libprotobuf-dev protobuf-compiler liblzma-dev
libagg-dev
libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
qtdeclarative5-dev libqt5svg5-dev qtlocation5-dev qtpositioning5-dev qttools5-dev-tools
qttools5-dev qtmultimedia5-dev
libglm-dev libglew-dev libglut-dev
libmarisa-dev"
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
- name: Configure build project
run: meson setup --buildtype debugoptimized -Db_coverage=true --unity on debug
env:
CXX: g++
CC: gcc
- name: Build project
run: build-wrapper-linux-x86-64 --out-dir sonar-build-output ninja -C debug all test coverage
env:
CXX: g++
CC: gcc
- name: SonarCloud Scan
run: "sonar-scanner
-Dsonar.cfamily.compile-commands=sonar-build-output/compile_commands.json
-Dsonar.cfamily.cppunit.reportsPath=debug/meson-logs/testlog.junit.xml
-Dsonar.coverageReportPaths=debug/meson-logs/sonarqube.xml
-Dsonar.cfamily.cobertura.reportPaths=debug/meson-logs/coverage.xml
-Dsonar.token=$SONAR_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}