-
Notifications
You must be signed in to change notification settings - Fork 13
106 lines (81 loc) · 3.36 KB
/
c-cpp.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
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
98
99
100
101
102
103
104
105
106
name: C++ Build
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development
jobs:
setup:
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update apt-get
run: apt-get update
- name: Install project dependencies
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git doxygen curl unzip
- name: Print GCC version
run: gcc --version
- name: Install CA certificates
run: apt-get install -y ca-certificates
build_test_and_analyse:
needs: setup
runs-on: ubuntu-latest
container:
image: debian:bookworm
env:
# https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update apt-get
run: apt-get update
- name: Install project dependencies
run: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git curl unzip gcovr
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Configure CMake
run: cmake -S . -B build -DSONARQUBE_ANALYSIS=ON -DDEBUG=OFF
- name: Build with SonarQube BuildWrapper + CMake
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release -- -j $(nproc)
- name: Give execute permissions
run: chmod +x ./build/src/bins/orbitersdkd-tests/orbitersdkd-tests
- name: Run Catch2 Tests
run: ./build/src/bins/orbitersdkd-tests/orbitersdkd-tests -d yes
- name: Collect coverage into one XML report
run: |
gcovr --gcov-ignore-parse-errors --sonarqube > coverage.xml
- name: Run SonarQube Scanner
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.coverageReportPaths=coverage.xml
documentation:
needs: build_test_and_analyse
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name : Update apt-get
run: apt-get update
- name : Install Doxygen
run: apt-get install -y doxygen
- name: Generate Doxygen Documentation
run: |
mkdir docs
doxygen Doxyfile
- name: Publish Documentation
uses: actions/upload-artifact@v4
with:
name: Documentation
path: docs