-
Notifications
You must be signed in to change notification settings - Fork 12
207 lines (193 loc) · 6.66 KB
/
ci.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: ci
on:
pull_request:
release:
types: [published]
push:
# tags:
# branches:
# - main
# - develop
env:
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
jobs:
Clang-tidy:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: llvm
build_type: Release
doxygen: "OFF"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: llvm
cmake: true
conan: "2.0.17"
clangtidy: true
- name: Setup Linux
run: |
sudo apt install -y libglfw3-dev libglfw3
- name: Installing conan
run: |
pip install conan
- name: Checking conan version
run: |
conan --version
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=Release
- name: Configure CMake
run: |
cmake -B ./build -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake" -DENABLE_MAIN=ON -DENABLE_TESTING=ON -DENABLE_DOXYGEN=OFF -DLOG_LEVEL=DATA -DWARNINGS_AS_ERRORS=ON -DENABLE_CPPCHECK=OFF -DENABLE_CLANG_TIDY=ON -DENABLE_INCLUDE_WHAT_YOU_USE=OFF
- name: Copy compile commands
run: |
cmake --build ./build --target copy-compile-commands --config Release
- name: Run clang-tidy on ./src
run: |
python3 ./tools/run-clang-tidy.py $PWD/src
- name: Run clang-tidy on ./test
run: |
python3 ./tools/run-clang-tidy.py $PWD/test
Documentation:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: gcc
build_type: Release
doxygen: "ON"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: gcc
cmake: true
conan: "2.0.17"
doxygen: true
- name: Setup Linux
run: |
sudo apt install -y libglfw3-dev libglfw3
sudo apt install -y flex bison graphviz dia mscgen pdf2svg texlive texlive-lang-german texlive-latex-extra ghostscript
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system/*'
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=Release
- name: Configure CMake
run: |
cmake -B ./build -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake" -DENABLE_MAIN=OFF -DENABLE_TESTING=OFF -DENABLE_DOXYGEN=ON -DLOG_LEVEL=OFF -DENABLE_CLANG_TIDY=OFF -DENABLE_CPPCHECK=OFF -DENABLE_INCLUDE_WHAT_YOU_USE=OFF -DDOC_CHECK_CODE_DOCUMENTATION=YES
- name: Check documentation
run: |
cmake --build ./build --target doc --config Release
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2022
compiler:
# you can specify the version after `-` like "llvm-13.0.0".
- llvm
- gcc
- msvc
build_type:
- Release
- Debug
log-level:
- "DEBUG"
exclude:
- os: ubuntu-22.04
compiler: msvc
- os: macos-12
compiler: gcc
- os: macos-12
compiler: msvc
- os: windows-2022
compiler: gcc
- os: windows-2022
compiler: llvm
include:
# Add appropriate variables for gcov version required. This will intentionally break
# if you try to use a compiler that does not have gcov set
- compiler: gcc
gcov_executable: gcov
- compiler: llvm
gcov_executable: "llvm-cov gcov"
- os: ubuntu-22.04
compiler: gcc
build_type: Release
log-level: "OFF"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
doxygen: "OFF"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
brew: true
conan: "2.0.17"
ccache: true
gcovr: true
- name: Setup MacOS
if: ${{ runner.os == 'macOS' }}
run: |
brew install glfw
- name: Setup Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y libglfw3-dev libglfw3
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system/*'
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=${{matrix.build_type}}
- name: Configure CMake
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE="build/${{matrix.build_type}}/generators/conan_toolchain.cmake" -DENABLE_MAIN=TRUE -DENABLE_TESTING=TRUE -DENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DENABLE_DOXYGEN=OFF -DLOG_LEVEL:STRING=${{matrix.log-level}} -DWARNINGS_AS_ERRORS:BOOL=${{ !contains(matrix.os, 'windows' )}} -DENABLE_CPPCHECK=OFF -DENABLE_CLANG_TIDY=OFF -DENABLE_INCLUDE_WHAT_YOU_USE=OFF
- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}} --output-on-failure --timeout 180
- name: Coverage
if: ${{ runner.os != 'Windows' && matrix.build_type == 'Debug' }}
run: |
mkdir -p build/coverage
gcovr --config doc/coverage/gcovr.cfg --gcov-executable '${{ matrix.gcov_executable }}'
- name: Publish to codecov
uses: codecov/codecov-action@v3
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/cobertura.xml