-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (83 loc) · 3.23 KB
/
c-cpp.yml
File metadata and controls
97 lines (83 loc) · 3.23 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# TODO https://github.com/philips-software/embeddedinfralib
name: C/C++ CI
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest tox tox-gh-actions scons
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements.testing.txt ]; then pip install -r requirements.testing.txt; fi
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Conan version
run: echo "${{ steps.conan.outputs.version }}"
- name: Build cmake
shell: bash
run: |
curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -o build-wrapper-linux-x86.zip
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-outputs cmake --build build --config Debug
#- name: configure
# run: ./configure
- name: Build make scons
run: make
#- name: make check
# run: make check
#- name: make distcheck
# run: make distcheck
#- name: Build and Test
# run: |
# cmake -E make_directory Build && cd Build
# cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug
# cmake --build .
# ctest -C Debug -T Test --output-on-failure
static_analysis:
runs-on: ubuntu-latest
steps:
- name: Install
run: |
wget http://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip && chmod +x ${{ github.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64
pip3 install gcovr==4.2
- name: Checkout
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Build and Test
run: |
cmake -E make_directory Build && cd Build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug
${{ github.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir ../bw-outputs cmake --build . --config Debug
ctest -C Debug -T Test --output-on-failure
gcovr --sonarqube=../coverage.xml --exclude-unreachable-branches --exclude-throw-branches --root=.. --exclude=.*/generated/.* --exclude=.*/external/.* --exclude=.*/lwip/.* --exclude=.*/tracing/.* --exclude=.*/test/.*
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v1.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}