-
Notifications
You must be signed in to change notification settings - Fork 141
245 lines (235 loc) · 8.6 KB
/
build.yaml
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
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_ubuntu:
name: BlazingMQ build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -qy build-essential \
gdb \
curl \
python3.10 \
python3-pip \
cmake \
ninja-build \
pkg-config \
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libz-dev
- name: Create dependency fetcher working directory
run: mkdir -p deps
- name: Fetch & Build non packaged dependencies
working-directory: deps
run: ../docker/build_deps.sh
- name: Build BlazingMQ
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig
run: |
cmake -S . -B build/blazingmq -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DBDE_BUILD_TARGET_SAFE=ON \
-DBDE_BUILD_TARGET_64=ON \
-DBDE_BUILD_TARGET_CPP17=ON \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \
-DCMAKE_INSTALL_LIBDIR=lib64
cmake --build build/blazingmq --parallel 8 --target all all.t
- name: Run C++ Unit Tests
run: |
cd ${{ github.workspace }}/build/blazingmq
ctest -E mwcsys_executil.t --output-on-failure
- name: Clean-up build directories before caching
run: |
find . -name "*.o" -type f -delete
find . -name "*.a" -type f -delete
find . -name "*.t.tsk" -type f -delete
- uses: actions/cache@v4
with:
path: |
build/blazingmq
deps
/opt/bb/include
key: cache-${{ github.sha }}
unit_tests_ubuntu:
name: BlazingMQ unit tests
runs-on: ubuntu-latest
needs: build_ubuntu
steps:
- uses: actions/checkout@v4
- uses: actions/cache/@v4
with:
path: |
build/blazingmq
deps
/opt/bb/include
key: cache-${{ github.sha }}
- name: Run Python Unit Tests
env:
PYTHONPATH: ${{ github.workspace }}/src/python
run: |
pip install -r ${{ github.workspace }}/src/python/requirements.txt
cd ${{ github.workspace }}
src/python/bin/schemagen
src/python/bin/tweakgen
pytest src/python
integration_tests_ubuntu:
name: BlazingMQ integration tests
runs-on: ubuntu-latest
needs: build_ubuntu
steps:
- uses: actions/checkout@v4
- uses: actions/cache/@v4
with:
path: |
build/blazingmq
deps
/opt/bb/include
key: cache-${{ github.sha }}
- name: Run Integration Tests
run: |
pip install -r ${{ github.workspace }}/src/python/requirements.txt
${{ github.workspace }}/src/integration-tests/run-tests \
--log-level ERROR \
--log-file-level=info \
--bmq-tolerate-dirty-shutdown \
--bmq-log-dir=failure-logs \
--bmq-log-level=INFO \
--junitxml=integration-tests.xml \
--tb line \
--reruns=3 \
-n 4 -v
build_macosx:
name: Build macosx_${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-14
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
brew install \
curl \
ninja \
bison \
flex \
google-benchmark
- name: Build BlazingMQ
run: bin/build-darwin.sh
build_and_test_bmqprometheus_plugin:
name: "Check if BMQPrometheus plugin can build and pass tests"
runs-on: ubuntu-latest
needs: build_ubuntu
steps:
- uses: actions/checkout@v4
- uses: actions/cache/@v4
with:
path: |
build/blazingmq
deps
/opt/bb/include
key: cache-${{ github.sha }}
- name: Set up plugins dependencies
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -qy build-essential \
gdb \
curl \
python3.10 \
cmake \
ninja-build \
pkg-config \
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libz-dev \
autoconf \
libtool
- name: Create dependency fetcher working directory
run: mkdir -p deps
- name: Fetch & Build non packaged plugins dependencies
working-directory: deps
run: ${{ github.workspace }}/src/plugins/bmqprometheus/build_prometheus_deps.sh
- name: Build plugins
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig
run: |
cmake -S . -B build/blazingmq -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DBDE_BUILD_TARGET_SAFE=ON \
-DBDE_BUILD_TARGET_64=ON \
-DBDE_BUILD_TARGET_CPP17=ON \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \
-DCMAKE_INSTALL_LIBDIR=lib64 \
-DINSTALL_TARGETS=prometheus
cmake --build build/blazingmq --parallel 8 --target all
- name: Create prometheus dir
run: mkdir -p prometheus_dir
- name: Download Prometheus
run: curl -SL "https://github.com/prometheus/prometheus/releases/download/v2.45.1/prometheus-2.45.1.linux-amd64.tar.gz" | tar -xzC prometheus_dir/
- name: Run Prometheus
run: ./prometheus_dir/prometheus-2.45.1.linux-amd64/prometheus --config.file=${{ github.workspace }}/src/plugins/bmqprometheus/tests/prometheus_localhost.yaml --web.enable-lifecycle --storage.tsdb.path=${{ github.workspace }}/prometheus_dir/data &
- name: Run Pushgateway
run: |
docker pull prom/pushgateway
docker run -d -p 9091:9091 prom/pushgateway
- name: Run BMQPrometheus plugin integration test in "pull" mode
run: ${{ github.workspace }}/src/plugins/bmqprometheus/tests/bmqprometheus_prometheusstatconsumer_test.py -p ${{ github.workspace }}/build/blazingmq -m pull --no-docker
- name: Clear Prometheus database and restart
run: |
curl -X POST "http://localhost:9090/-/quit"
rm -rf prometheus_dir/data
./prometheus_dir/prometheus-2.45.1.linux-amd64/prometheus --config.file=${{ github.workspace }}/src/plugins/bmqprometheus/tests/prometheus_localhost.yaml --web.enable-lifecycle --storage.tsdb.path=${{ github.workspace }}/prometheus_dir/data &
- name: Run Prometheus plugin integration test in "push" mode
run: ${{ github.workspace }}/src/plugins/bmqprometheus/tests/bmqprometheus_prometheusstatconsumer_test.py -p ${{ github.workspace }}/build/blazingmq -m push --no-docker
documentation:
name: "Documentation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -qy doxygen
- name: Build docs
run: |
doxygen Doxyfile
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
docker-build-check:
name: "Check whether docker single-node and cluster workflows build correctly."
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Single-Node Workflow
run: docker compose -f docker/single-node/docker-compose.yaml up --build -d
- name: Docker Cluster Workflow
run: docker compose -f docker/cluster/docker-compose.yaml up --build -d