-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (38 loc) · 1.13 KB
/
quality_check_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
# GitHub Actions for genCMPClient
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Siemens AG, 2021-2023
name: Static Analysis using SonarCloud
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: cmake
run: |
USE_LIBCMP=1 cmake .
make
- name: test-coverage
run: |
USE_LIBCMP=1 make -f Makefile_v1 clean_all build
USE_LIBCMP=1 make -f Makefile_v1 test_Mock
find . -name *.gcno -exec gcov {} \;
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner -Dproject.settings=.github/workflows/sonar-project.properties