-
Notifications
You must be signed in to change notification settings - Fork 68
51 lines (51 loc) · 1.53 KB
/
sonar-scanner.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
on:
push:
branches:
- develop
- master
- "release/*"
pull_request:
types: [opened, synchronize, reopened]
name: Sonar Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
container:
image: ubuntu:jammy-20230126
steps:
- name: Install curl, zip, git, gcovr
# Installing gcovr for unit test code coverage
# Installing git for checkout action
# installing curl/zip for sonar-cpp action
run: |
apt update
export DEBIAN_FRONTEND=noninteractive
apt-get install -y curl zip git gcovr
- name: Checkout
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
submodules: recursive
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: Run install_dependencies.sh script
run: |
scripts/install_dependencies.sh
- name: Build Ext Components
run: |
cd ext
./build.sh
../container/library.sh
ldconfig
- name: Run Tests & Generate Gcovr Reports
run: |
mkdir bw-output
cd src
build-wrapper-linux-x86-64 --out-dir ../bw-output bash build.sh
./coverage.sh
- name: Run sonar-scanner
uses: usdot-fhwa-stol/actions/sonar-scanner@main
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}
working-dir: ${{ github.workspace }}