-
Notifications
You must be signed in to change notification settings - Fork 17
248 lines (232 loc) · 8 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: Continuous Integration
# Run this workflow every time a new commit pushed to your repository
on: [push, pull_request]
env:
DEPS_DIR: ${{ github.workspace}}/deps
HUNTER_ROOT: ${{ github.workspace}}/hunter
defaults:
run:
shell: bash
jobs:
clang-format:
name: clang-format-17
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: false
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - &&
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" &&
sudo apt-get install clang-format-17
- name: clang-format
run: "./ci/run-clang-format.py -r --clang-format-executable clang-format-17 --color always ./lib/ ./projects/ ./examples/"
clang-tidy:
name: clang-tidy-17 ${{ matrix.name }}
needs: clang-format
runs-on: ubuntu-20.04
container: craffael/feen-ci:clang17
strategy:
matrix:
include:
- name: without projects
paths: "'^((?!snippets|/test/|/test_utils/|/projects/).)*$'"
- name: only projects
paths: "'^.*projects/((?!snippets|/test/|/test_utils/).)*$'"
env:
COMPILER: "clang++-17"
BUILD_TYPE: "Debug"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install clang-tidy
run: apt update && apt install -y clang-tidy-17 python-is-python3
- name: Restore cache
uses: actions/cache/restore@v3
with:
path: "${{ env.DEPS_DIR }} ${{ env.HUNTER_ROOT }}"
key: ${{ runner.os }}-${{ env.COMPILER }}-${{ env.BUILD_TYPE }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-${{ env.COMPILER }}-${{ env.BUILD_TYPE }}-
${{ runner.os }}-${{ env.COMPILER }}-
- name: build_dependencies
run: "./ci/build_dependencies.sh"
- name: Save Cache
uses: actions/cache/save@v3
if: always()
with:
path: |
${{ env.DEPS_DIR }}
${{ env.HUNTER_ROOT }}
key: ${{ runner.os }}-${{ env.COMPILER }}-${{ env.BUILD_TYPE }}-${{ github.run_id }}
- name: clang-tidy
run: "./ci/run_clang_tidy.sh ${{ matrix.paths}}"
# compilation on linux/osx:
compile_test:
name: ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.build_type }}
needs: clang-format
strategy:
matrix:
include:
- os: ubuntu-20.04
container: craffael/feen-ci:clang17
compiler: "clang++-17"
packages: ""
build_type: "Debug"
cxx_flags: "-g0 -Werror=#warnings"
- os: ubuntu-20.04
container: craffael/feen-ci:clang17
compiler: "clang++-17"
packages: ""
build_type: "Release"
cxx_flags: "-g0 -Werror=#warnings"
- os: ubuntu-20.04
container: craffael/feen-ci:gcc13
compiler: "g++-13"
packages: ""
build_type: "Debug"
cxx_flags: "-g0 -Werror=cpp"
- os: ubuntu-20.04
container: craffael/feen-ci:gcc13
compiler: "g++-13"
packages: ""
build_type: "Release"
cxx_flags: "-g0 -Werror=cpp"
- os: macos-12
compiler: "clang++"
build_type: "Debug"
cxx_flags: "-g0 -Werror=#warnings"
- os: macos-12
compiler: "clang++"
build_type: "Release"
cxx_flags: "-g0 -Werror=#warnings"
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
COMPILER: ${{ matrix.compiler }}
BUILD_TYPE: ${{ matrix.build_type }}
CXXFLAGS: ${{ matrix.cxx_flags }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install packages
if: (runner.os == 'Linux') && (matrix.packages != '')
run: sudo apt-get install ${{ matrix.packages }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: false
- name: Restore cache
uses: actions/cache@v2
with:
path: |
${{ env.DEPS_DIR }}
${{ env.HUNTER_ROOT }}
key: ${{ runner.os }}-${{ env.COMPILER }}-${{ env.BUILD_TYPE }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-${{ env.COMPILER }}-${{ env.BUILD_TYPE }}-
${{ runner.os }}-${{ env.COMPILER }}-
- name: build_dependencies
run: "./ci/build_dependencies.sh"
- name: compile and test
run: "./ci/compile_test.sh"
windows:
name: Windows x64 - ${{ matrix.build_type }}
needs: clang-format
runs-on: windows-latest
defaults:
run:
shell: pwsh
env:
HUNTER_ROOT: C:\.hunter
strategy:
matrix:
include:
- build_type: "Debug"
compiler: "msvc"
# - build_type: "Release"
# compiler: "msvc"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Restore cache
uses: actions/cache/restore@v3
with:
path: "${{ env.HUNTER_ROOT }}"
key: ${{ runner.os }}-msvc-${{ matrix.build_type }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-msvc-${{ matrix.build_type }}-
${{ runner.os }}-msvc-
# Note that windows has a recent version of cmake installed -> we don't need to install it here.
# we set CMAKE_CXX_FLAGS_DEBUG explictly to avoid the creation of pdb files (which fill up disk space)
- name: Hunter dependencies
run: |
mkdir build > $null
cd build
cmake -A x64 -D HUNTER_CONFIGURATION_TYPES=${{ matrix.build_type }} -D CMAKE_CXX_FLAGS_DEBUG="/MDd /Ob0 /Od /RTC1" ..
- name: Save Cache
uses: actions/cache/save@v3
if: always()
with:
path: |
${{ env.HUNTER_ROOT }}
key: ${{ runner.os }}-msvc-${{ matrix.build_type }}-${{ github.run_id }}
- name: compile
run: |
cmake --build ./build --config ${{ matrix.build_type }} --target ALL_BUILD -j2
- name: test
run: |
cd build
ctest -j 2 -c ${{ matrix.build_type }} --output-on-failure
doxygen:
name: doxygen
runs-on: ubuntu-20.04
needs: [clang-format]
container: craffael/feen-ci:doxygen
env:
CXX: "clang++-17"
BUILD_TYPE: "Debug"
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Restore cache
uses: actions/cache@v2
with:
path: |
${{ env.DEPS_DIR }}
${{ env.HUNTER_ROOT }}
key: ${{ runner.os }}-clang++-17-Doxygen-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-clang++-17-Doxygen-
${{ runner.os }}-clang++-17-Debug-
- name: doxygen
run: |
cmake -H. -BBuild -DLF_DOX_INCLUDE_PROJECTS=On -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
cd Build
make doxygen
cd doc/doxygen/html
mkdir with_projects
shopt -s extglob
mv !(with_projects) with_projects
cd ../../..
cmake -DLF_DOX_INCLUDE_PROJECTS=OFF .
unbuffer make doxygen 2>&1 | tee output
if grep -q "warning:" "output"; then
echo -e "\033[0;31mDoxygen produced warnings:\033[0m"
grep "warning:" "output"
exit 1
fi
- name: deploy
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/master'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: "./Build/doc/doxygen/html"
CLEAN: true