forked from apache/qpid-dispatch
-
Notifications
You must be signed in to change notification settings - Fork 1
343 lines (288 loc) · 11.1 KB
/
build.yaml
File metadata and controls
343 lines (288 loc) · 11.1 KB
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
compile:
name: "Compile (${{matrix.os}}, ${{matrix.runtimeCheck}})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
buildType: [RelWithDebInfo]
runtimeCheck: [asan]
env:
BuildType: ${{matrix.buildType}}
ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
InstallPrefix: ${{github.workspace}}/install
ProtonCMakeExtraArgs: >
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DBUILD_BINDINGS=python
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DENABLE_FUZZ_TESTING=OFF
-DRUNTIME_CHECK=${{matrix.runtimeCheck}}
DispatchCMakeExtraArgs: >
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG
-DQD_ENABLE_ASSERTIONS=ON
-DCONSOLE_INSTALL=OFF
-DUSE_BWRAP=ON
-DRUNTIME_CHECK=${{matrix.runtimeCheck}}
-DSANITIZE_3RD_PARTY=ON
CCACHE_BASEDIR: ${{github.workspace}}
CCACHE_DIR: ${{github.workspace}}/.ccache
CCACHE_COMPRESS: 'true'
CCACHE_MAXSIZE: '400MB'
steps:
- name: Show environment (Linux)
if: ${{ always() && runner.os == 'Linux' }}
run: env -0 | sort -z | tr '\0' '\n'
- uses: actions/checkout@v2
with:
repository: 'apache/qpid-proton'
ref: 'master'
path: 'qpid-proton'
- uses: actions/checkout@v2
with:
path: 'qpid-dispatch'
# https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- uses: actions/cache@v2.1.4
env:
cache-name: cache-ccache
with:
path: .ccache
key: ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name }}
- name: Create Build and Install directories
run: mkdir -p "${ProtonBuildDir}" "${DispatchBuildDir}" "{InstallPrefix}"
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Install Python build dependencies
run: python -m pip install setuptools wheel tox
- name: Install Linux build dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev libwebsockets-dev libnghttp2-dev ccache ninja-build pixz
- name: Zero ccache stats
run: ccache -z
- name: qpid-proton cmake configure
working-directory: ${{env.ProtonBuildDir}}
run: >
cmake "${{github.workspace}}/qpid-proton" \
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" \
"-DCMAKE_BUILD_TYPE=${BuildType}" \
"-GNinja" \
${ProtonCMakeExtraArgs}
- name: qpid-proton cmake build/install
run: cmake --build "${ProtonBuildDir}" --config ${BuildType} -t install
- name: Display ccache stats
run: ccache -s
- name: qpid-dispatch cmake configure
working-directory: ${{env.DispatchBuildDir}}
run: >
cmake "${{github.workspace}}/qpid-dispatch" \
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" \
"-DCMAKE_BUILD_TYPE=${BuildType}" \
"-GNinja" \
${DispatchCMakeExtraArgs}
- name: qpid-dispatch cmake build/install
run: cmake --build "${DispatchBuildDir}" --config ${BuildType} -t install
- name: Display ccache stats
run: ccache -s
# github actions/upload-artifact@v2 does not preserve executable permission on binaries
- name: Compress build
working-directory: ${{github.workspace}}
run: >
tar \
-I pixz \
-cf /tmp/archive.tar.xz \
--exclude '*.o' \
--exclude '*.pyc' \
--exclude '.git' \
--exclude='qpid-dispatch/build/console' \
qpid-dispatch \
install \
qpid-proton/build/python/pkgs
- name: Upload archive
uses: actions/upload-artifact@v2
with:
name: qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
path: /tmp/archive.tar.xz
test:
name: 'Test (${{matrix.os}}, ${{matrix.runtimeCheck}}, shard ${{matrix.shard}} of ${{matrix.shards}})'
runs-on: ${{ matrix.os }}
needs: [compile]
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
buildType: [RelWithDebInfo]
runtimeCheck: [asan]
shard: [1, 2]
shards: [2]
env:
BuildType: ${{matrix.buildType}}
ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
InstallPrefix: ${{github.workspace}}/install
LD_LIBRARY_PATH: ${{github.workspace}}/install/lib
steps:
- name: Show environment (Linux)
if: ${{ always() && runner.os == 'Linux' }}
run: env -0 | sort -z | tr '\0' '\n'
- name: Download Build
uses: actions/download-artifact@v2
with:
name: qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Install Python runtime/test dependencies
run: python -m pip install tox quart selectors grpcio protobuf
- name: Install Linux runtime/test dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y libsasl2-2 libsasl2-modules sasl2-bin libjsoncpp1 libwebsockets15 pixz bubblewrap curl
- name: Unpack archive
run: tar -I pixz -xf archive.tar.xz
- name: install qpid-proton python wheel
run: python -m pip install ${ProtonBuildDir}/python/pkgs/python_qpid_proton*.whl
- name: CTest
working-directory: ${{env.DispatchBuildDir}}
run: |
ulimit -c unlimited
ctest -C ${BuildType} -V -T Test --no-compress-output -I ${{matrix.shard}},,${{matrix.shards}} -j2
- name: Upload test results
uses: actions/upload-artifact@v2
if: ${{ ! cancelled() }}
with:
name: Test_Results_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}_${{matrix.shard}}
path: ${{env.DispatchBuildDir}}/Testing/**/*.xml
- name: Upload core files (if any)
uses: actions/upload-artifact@v2
if: failure()
with:
name: cores_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}_${{matrix.shard}}
path: |
**/core
docs:
name: 'Docs (${{ matrix.os }})'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
buildType: [ RelWithDebInfo ]
env:
DispatchBuildDir: ${{github.workspace}}/build
InstallPrefix: ${{github.workspace}}/install
DispatchCMakeExtraArgs: >
-DCONSOLE_INSTALL=OFF
steps:
- uses: actions/checkout@v2
- name: Create Build and Install directories
run: mkdir -p "${DispatchBuildDir}" "{InstallPrefix}"
- name: Add Qpid PPA repository
if: ${{ runner.os == 'Linux' }}
# the `released` ppa does not yet have Proton 0.33.0, have to use `testing`
run: |
sudo add-apt-repository ppa:qpid/testing && sudo apt-get update
- name: Install Linux build dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y libqpid-proton-proactor1-dev python3-qpid-proton libpython3-dev libwebsockets-dev libnghttp2-dev
- name: "Workaround for: make[3]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libqpid-proton-core.so', needed by 'src/libqpid-dispatch.so'. Stop."
if: ${{ runner.os == 'Linux' }}
run: sudo ln -s /usr/lib/x86_64-linux-gnu/libqpid-proton-core.so.10 /usr/lib/x86_64-linux-gnu/libqpid-proton-core.so
- name: Install Linux docs dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y asciidoc asciidoctor dblatex
- name: qpid-dispatch cmake configure
working-directory: ${{env.DispatchBuildDir}}
run: >
cmake "${{github.workspace}}" \
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" \
${DispatchCMakeExtraArgs}
- name: CMake build for docs
run: cmake --build "${DispatchBuildDir}" -t docs
- name: Store the rendered user-guide
uses: actions/upload-artifact@v2
with:
name: UserGuide
path: ${{env.DispatchBuildDir}}/docs/books/user-guide
- name: Store the rendered html man pages
uses: actions/upload-artifact@v2
with:
name: Manpages
path: ${{env.DispatchBuildDir}}/docs/man/*.html
console-test:
name: Console Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: cd console/react && npm ci
- name: Run Tests
run: cd console/react && npm run test
console-eslint:
name: Console ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: cd console/react && npm ci
- name: Run ESLint
run: cd console/react && npx eslint --max-warnings 0 .
rat_check:
name: RAT Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: 11
- name: RAT Check
run: mvn apache-rat:check
- name: Output
if: ${{ ! cancelled() }}
run: cat target/rat.txt || echo "Unable to print output"