-
Notifications
You must be signed in to change notification settings - Fork 5
230 lines (184 loc) · 6.4 KB
/
pipeline.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
name: Libdbc Pipeline
on: [push, workflow_call]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
linux-builds:
name: linux ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cxx:
- g++-11
- clang++-16
build_type: [Debug, Release]
std: [11]
include:
- cxx: g++-11
cc: gcc-11
- cxx: clang++-16
cc: clang-16
llvm_version: 16
env:
BUILD_TYPE: ${{matrix.build_type}}
steps:
- uses: actions/checkout@v4
- name: Install clang
if: ${{ matrix.llvm_version }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm_version }}
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen de_DE.UTF-8
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
- name: Print gcc version
run: gcc --version
- name: Configure build
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=ON \
-DDBC_TEST_LOCALE_INDEPENDENCE=ON \
-DDBC_GENERATE_SINGLE_HEADER=ON
- name: Build tests + lib
run: cmake --build build --parallel `nproc`
- name: Run tests
timeout-minutes: 3
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --output-on-failure --test-dir build -j `nproc`
- name: Run install
run: cmake --install build --prefix .
windows-build:
name: ${{matrix.os}}, ${{matrix.std}}, ${{matrix.build_type}}, ${{matrix.platform}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
platform: [Win32, x64]
build_type: [Debug, Release]
std: [11]
env:
BUILD_TYPE: ${{matrix.build_type}}
steps:
- uses: actions/checkout@v4
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -S $Env:GITHUB_WORKSPACE `
-B ${{runner.workspace}}/build `
-A ${{matrix.platform}} `
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} `
-DCMAKE_CXX_STANDARD=${{matrix.std}} `
-DCMAKE_CXX_STANDARD_REQUIRED=ON `
-DCMAKE_CXX_EXTENSIONS=ON `
-DDBC_TEST_LOCALE_INDEPENDENCE=ON
- name: Build tests + lib
working-directory: ${{runner.workspace}}
run: cmake --build build --config ${{matrix.build_type}} --parallel %NUMBER_OF_PROCESSORS%
shell: cmd
- name: Run tests
timeout-minutes: 3
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}
run: ctest --output-on-failure --test-dir build -j %NUMBER_OF_PROCESSORS%
shell: cmd
macos-builds:
name: macos ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: macos-12
strategy:
fail-fast: false
matrix:
cxx:
- g++
- clang++
build_type: [Debug, Release]
std: [11]
include:
- cxx: g++
cc: gcc
- cxx: clang++
cc: clang
env:
BUILD_TYPE: ${{matrix.build_type}}
steps:
- uses: actions/checkout@v4
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
run: |
cmake -Bbuild -H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=ON \
-DDBC_TEST_LOCALE_INDEPENDENCE=ON
- name: Build tests + lib
working-directory: ${{runner.workspace}}
run: cmake --build build --parallel `sysctl -n hw.ncpu`
- name: Run tests
timeout-minutes: 3
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}
run: ctest --output-on-failure --test-dir build -j `sysctl -n hw.ncpu` -V
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format version
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt update && sudo apt install -y clang-format-17
sudo ln -sf $(which clang-format-17) $(which clang-format)
test "$(clang-format --version)" == "$(clang-format-17 --version)"
- name: Test format with clang format
run: ./scripts/fmt.sh
clang-tidy-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-tidy version
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt update && sudo apt install -y clang-tidy-17
sudo ln -sf $(which clang-tidy-17) $(which clang-tidy)
test "$(clang-tidy --version)" == "$(clang-tidy-17 --version)"
- name: Make build directory
run: cmake -Bbuild -H$GITHUB_WORKSPACE
- name: Run clang-tidy check
run: cmake --build build --target clang-tidy-check
check-against-minimum-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cmake install
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.16.9/cmake-3.16.9-linux-x86_64.sh
chmod +x cmake-3.16.9-linux-x86_64.sh
sudo ./cmake-3.16.9-linux-x86_64.sh --skip-license --prefix=/usr/local
cmake --version
- name: Make build directory
run: cmake -Bbuild -H$GITHUB_WORKSPACE
- name: Run build
run: cmake --build build