generated from embedded-dev-research/cpp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (127 loc) · 3.47 KB
/
main.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build application
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'
jobs:
ubuntu-gcc-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get install -y cmake ninja-build ccache scons
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
create-symlink: true
- name: Configure
run: >
cmake -S . -B build
-GNinja
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: |
cmake --build build --parallel
ubuntu-clang-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get install -y cmake ninja-build ccache scons
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
create-symlink: true
- name: Configure
run: >
cmake -S . -B build
-GNinja
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: |
cmake --build build --parallel
macos-clang-build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
brew install ninja scons
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
create-symlink: true
- name: Configure
run: >
cmake -S . -B build
-GNinja
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: |
cmake --build build --parallel
ubuntu-gcc-build-codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get install -y cmake ninja-build ccache gcovr lcov scons
- uses: actions/checkout@v4
with:
submodules: true
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
create-symlink: true
- name: Configure
run: >
cmake -S . -B build
-GNinja
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_FLAGS="--coverage"
-DCMAKE_CXX_FLAGS="--coverage"
- name: Build
run: |
cmake --build build --parallel
- name: Test
run: |
build/bin/run_tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Generate lcov Coverage Data
run: |
cd build
lcov --capture --directory . --output-file ../coverage.info
lcov --remove ../coverage.info '*/3rdparty/*' '/usr/*' '*/test/*' --output-file ../coverage.info
cd ..
genhtml coverage.info --output-directory cov-report
continue-on-error: true
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
with:
name: cov-report
path: 'cov-report'
- name: Generate gcovr Coverage Data
run: |
cd build
gcovr -r ../ --xml --output ../coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml