3
3
pull_request :
4
4
push :
5
5
# If the branches list is ever changed, be sure to change it on all
6
- # build/test jobs (nix, macos, windows, instrumentation )
6
+ # build/test jobs (nix, macos, windows)
7
7
branches :
8
8
# Always build the package branches
9
9
- develop
@@ -15,9 +15,9 @@ concurrency:
15
15
group : ${{ github.workflow }}-${{ github.ref }}
16
16
cancel-in-progress : true
17
17
18
- # This workflow has two job matrixes.
19
- # They can be considered phases because the second matrix ("test")
20
- # depends on the first ("dependencies").
18
+ # This workflow has multiple job matrixes.
19
+ # They can be considered phases because most of the matrices ("test",
20
+ # "coverage", "conan", ) depend on the first ("dependencies").
21
21
#
22
22
# The first phase has a job in the matrix for each combination of
23
23
# variables that affects dependency ABI:
@@ -30,9 +30,12 @@ concurrency:
30
30
# to hold the binaries if they are built locally.
31
31
# We must use the "{upload,download}-artifact" actions instead.
32
32
#
33
- # The second phase has a job in the matrix for each test configuration.
34
- # It installs dependency binaries from the cache, whichever was used,
35
- # and builds and tests rippled.
33
+ # The remaining phases have a job in the matrix for each test
34
+ # configuration. They install dependency binaries from the cache,
35
+ # whichever was used, and build and test rippled.
36
+ #
37
+ # "instrumentation" is independent, but is included here because it also
38
+ # builds on linux in the same "on:" conditions.
36
39
37
40
jobs :
38
41
dependencies :
@@ -293,3 +296,89 @@ jobs:
293
296
-DCMAKE_BUILD_TYPE=${configuration}
294
297
cmake --build .
295
298
./example | grep '^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'
299
+
300
+ # NOTE we are not using dependencies built above because it lags with
301
+ # compiler versions. Instrumentation requires clang version 16 or
302
+ # later
303
+
304
+ instrumentation-build :
305
+ env :
306
+ CLANG_RELEASE : 16
307
+ strategy :
308
+ fail-fast : false
309
+ runs-on : [self-hosted, heavy]
310
+ container : debian:bookworm
311
+ steps :
312
+ - name : install prerequisites
313
+ env :
314
+ DEBIAN_FRONTEND : noninteractive
315
+ run : |
316
+ apt-get update
317
+ apt-get install --yes --no-install-recommends \
318
+ clang-${CLANG_RELEASE} clang++-${CLANG_RELEASE} \
319
+ python3-pip python-is-python3 make cmake git wget
320
+ apt-get clean
321
+ update-alternatives --install \
322
+ /usr/bin/clang clang /usr/bin/clang-${CLANG_RELEASE} 100 \
323
+ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_RELEASE}
324
+ update-alternatives --auto clang
325
+ pip install --no-cache --break-system-packages "conan<2"
326
+
327
+ - name : checkout
328
+ uses : actions/checkout@v4
329
+
330
+ - name : prepare environment
331
+ run : |
332
+ mkdir ${GITHUB_WORKSPACE}/.build
333
+ echo "SOURCE_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
334
+ echo "BUILD_DIR=$GITHUB_WORKSPACE/.build" >> $GITHUB_ENV
335
+ echo "CC=/usr/bin/clang" >> $GITHUB_ENV
336
+ echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
337
+
338
+ - name : configure Conan
339
+ run : |
340
+ conan profile new --detect default
341
+ conan profile update settings.compiler=clang default
342
+ conan profile update settings.compiler.version=${CLANG_RELEASE} default
343
+ conan profile update settings.compiler.libcxx=libstdc++11 default
344
+ conan profile update settings.compiler.cppstd=20 default
345
+ conan profile update options.rocksdb=False default
346
+ conan profile update \
347
+ 'conf.tools.build:compiler_executables={"c": "/usr/bin/clang", "cpp": "/usr/bin/clang++"}' default
348
+ conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_DISABLE_CONCEPTS"' default
349
+ conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default
350
+ conan export external/snappy snappy/1.1.10@
351
+ conan export external/soci soci/4.0.3@
352
+
353
+ - name : build dependencies
354
+ run : |
355
+ cd ${BUILD_DIR}
356
+ conan install ${SOURCE_DIR} \
357
+ --output-folder ${BUILD_DIR} \
358
+ --install-folder ${BUILD_DIR} \
359
+ --build missing \
360
+ --settings build_type=Debug
361
+
362
+ - name : build with instrumentation
363
+ run : |
364
+ cd ${BUILD_DIR}
365
+ cmake -S ${SOURCE_DIR} -B ${BUILD_DIR} \
366
+ -Dvoidstar=ON \
367
+ -Dtests=ON \
368
+ -Dxrpld=ON \
369
+ -DCMAKE_BUILD_TYPE=Debug \
370
+ -DSECP256K1_BUILD_BENCHMARK=OFF \
371
+ -DSECP256K1_BUILD_TESTS=OFF \
372
+ -DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF \
373
+ -DCMAKE_TOOLCHAIN_FILE=${BUILD_DIR}/build/generators/conan_toolchain.cmake
374
+ cmake --build . --parallel $(nproc)
375
+
376
+ - name : verify instrumentation enabled
377
+ run : |
378
+ cd ${BUILD_DIR}
379
+ ./rippled --version | grep libvoidstar
380
+
381
+ - name : run unit tests
382
+ run : |
383
+ cd ${BUILD_DIR}
384
+ ./rippled -u --unittest-jobs $(( $(nproc)/4 ))
0 commit comments