-
Notifications
You must be signed in to change notification settings - Fork 5
169 lines (141 loc) · 4.93 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
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-latest
strategy:
fail-fast: false
matrix:
cxx:
- g++-13
- clang++-16
build_type: [Debug, Release]
std: [11]
include:
- cxx: g++-13
cc: gcc-13
- cxx: clang++-16
cc: clang-16
llvm_version: 16
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: 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
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --output-on-failure --test-dir build -j `nproc`
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]
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
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-latest
strategy:
fail-fast: false
matrix:
cxx:
- g++
- clang++
build_type: [Debug, Release]
std: [11]
include:
- cxx: g++
cc: gcc
- cxx: clang++
cc: clang
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
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}
run: ctest --output-on-failure --test-dir build -j `sysctl -n hw.ncpu`
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 16
sudo apt update && sudo apt install -y clang-format-16
sudo ln -sf $(which clang-format-16) $(which clang-format)
test "$(clang-format --version)" == "$(clang-format-16 --version)"
- name: Test format with clang format
run: ./scripts/fmt.sh