-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 1.84 KB
/
sonarcloud.yml
File metadata and controls
69 lines (58 loc) · 1.84 KB
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
66
67
68
69
name: SonarCloud
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
permissions:
contents: read
steps:
- name: Install libmodsecurity
run: |
sudo apt-get update -y
sudo apt-get install -y libmodsecurity-dev
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Node.js environment
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} npm run build
env:
CXXFLAGS: -Og --coverage -fprofile-abs-path -std=c++14
LDFLAGS: --coverage
- name: Run tests
run: npm test
- name: Process coverage report
run: |
mkdir coverage
cd coverage
find .. -name '*.o' | xargs gcov --preserve-paths
- name: Run sonar-scanner
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
"-Dsonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" -Dsonar.cfamily.gcov.reportsPath=coverage