Skip to content

Commit a6de581

Browse files
authored
Merge pull request #247 from pmienk/master
Regenerate with CMakePresets.
2 parents f73ed9c + 8c614a9 commit a6de581

File tree

5 files changed

+1553
-31
lines changed

5 files changed

+1553
-31
lines changed

.github/workflows/ci.yml

Lines changed: 201 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ jobs:
131131
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
132132
133133
- name: Denormalize parameterization
134+
shell: bash
134135
run: |
136+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
137+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
135138
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
136139
echo "ASSERT_NDEBUG=--enable-ndebug" >> $GITHUB_ENV
137140
else
@@ -143,15 +146,15 @@ jobs:
143146
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
144147
fi
145148
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
146-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
149+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
147150
fi
148151
149152
- name: Execute install.sh
150153
run: >
151154
./install.sh
152155
--enable-isystem
153-
--build-dir=${{ github.workspace }}/build
154-
--prefix=${{ github.workspace }}/prefixenv
156+
--build-dir=$LIBBITCOIN_SRC_PATH
157+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
155158
${{ env.LINKAGE }}
156159
${{ env.ASSERT_NDEBUG }}
157160
${{ matrix.boost }}
@@ -162,7 +165,7 @@ jobs:
162165
if: ${{ matrix.coverage == 'cov' }}
163166
run: |
164167
lcov --directory . --capture --output-file coverage.info
165-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
168+
lcov --remove coverage.info "/usr/*" "../prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
166169
lcov --list coverage.info
167170
168171
- name: Coveralls.io Upload
@@ -341,7 +344,10 @@ jobs:
341344
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
342345
343346
- name: Denormalize parameterization
347+
shell: bash
344348
run: |
349+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
350+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
345351
if [[ ${{ matrix.packager }} == 'brew' ]]; then
346352
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
347353
fi
@@ -356,14 +362,14 @@ jobs:
356362
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
357363
fi
358364
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
359-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
365+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
360366
fi
361367
362368
- name: Execute install-cmake.sh
363369
run: >
364370
./install-cmake.sh
365-
--build-dir=${{ github.workspace }}/build
366-
--prefix=${{ github.workspace }}/prefixenv
371+
--build-dir=$LIBBITCOIN_SRC_PATH
372+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
367373
${{ env.LINKAGE }}
368374
${{ env.ASSERT_NDEBUG }}
369375
${{ matrix.boost }}
@@ -374,7 +380,194 @@ jobs:
374380
if: ${{ matrix.coverage == 'cov' }}
375381
run: |
376382
lcov --directory . --capture --output-file coverage.info
377-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
383+
lcov --remove coverage.info "/usr/*" "../prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
384+
lcov --list coverage.info
385+
386+
- name: Coveralls.io Upload
387+
if: ${{ matrix.coverage == 'cov' }}
388+
uses: pmienk/coveralls-github-action@master
389+
with:
390+
path-to-lcov: "./coverage.info"
391+
github-token: ${{ secrets.github_token }}
392+
393+
- name: Failure display available binaries
394+
if: ${{ failure() }}
395+
run: |
396+
ls -la /usr/bin
397+
398+
- name: Failure display selected compiler version
399+
if: ${{ failure() }}
400+
run: |
401+
${CC} -v
402+
${CXX} -v
403+
404+
- name: Failure display default compiler version
405+
if: ${{ failure() }}
406+
run: |
407+
clang -v
408+
gcc -v
409+
410+
- name: Failure display env
411+
if: ${{ failure() }}
412+
run: |
413+
env
414+
415+
- name: Failure list libdir
416+
if: ${{ failure() }}
417+
run: |
418+
ls -la ${{ github.workspace }}/prefixenv/lib
419+
420+
- name: Failure display boost bootstrap.log [--build-boost]
421+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
422+
run: |
423+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
424+
425+
- name: Failure display otool output
426+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
427+
run: |
428+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-protocol-test
429+
430+
- name: Failure display DYLD_PRINT_LIBRARIES
431+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
432+
run: |
433+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-protocol-test
434+
435+
- name: Failure display pkgconfig
436+
if: ${{ failure() }}
437+
run: |
438+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
439+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
440+
441+
- name: Failure display cmake specific libraries
442+
if: ${{ failure() }}
443+
run: |
444+
ls ${{ github.workspace }}/prefixenv/lib/cmake
445+
446+
- name: Failure display cmake LastTest.log
447+
if: ${{ failure() }}
448+
run: |
449+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
450+
451+
preset:
452+
453+
strategy:
454+
fail-fast: false
455+
456+
matrix:
457+
include:
458+
- os: ubuntu-22.04
459+
preset: "nix-gnu-debug-shared"
460+
cxx: "clang++-14"
461+
link: "dynamic"
462+
optimization: "size"
463+
assert: "debug"
464+
coverage: "nocov"
465+
boost: "--build-boost"
466+
icu: ""
467+
zmq: "--build-zmq"
468+
cc: "clang-14"
469+
flags: "-Os -fPIE"
470+
packager: "apt"
471+
packages: ""
472+
473+
- os: ubuntu-22.04
474+
preset: "nix-gnu-release-static-size"
475+
cxx: "clang++-14"
476+
link: "static"
477+
optimization: "size"
478+
assert: "ndebug"
479+
coverage: "nocov"
480+
boost: "--build-boost"
481+
icu: "--build-icu --with-icu"
482+
zmq: "--build-zmq"
483+
cc: "clang-14"
484+
flags: "-Os -fPIE"
485+
packager: "apt"
486+
packages: ""
487+
488+
- os: ubuntu-22.04
489+
preset: "nix-gnu-release-shared-size"
490+
cxx: "g++-11"
491+
link: "dynamic"
492+
optimization: "size"
493+
assert: "ndebug"
494+
coverage: "nocov"
495+
boost: "--build-boost"
496+
icu: ""
497+
zmq: "--build-zmq"
498+
cc: "gcc-11"
499+
flags: "-Os -fPIE"
500+
packager: "apt"
501+
packages: ""
502+
503+
504+
runs-on: ${{ matrix.os }}
505+
506+
env:
507+
CC: '${{ matrix.cc }}'
508+
CXX: '${{ matrix.cxx }}'
509+
CFLAGS: '${{ matrix.flags }}'
510+
CXXFLAGS: '${{ matrix.flags }}'
511+
CI_REPOSITORY: '${{ github.repository }}'
512+
513+
steps:
514+
- name: Checkout repository
515+
uses: actions/checkout@v3
516+
517+
- name: Prepare toolchain [generic]
518+
run: |
519+
git config --global init.defaultBranch master
520+
521+
- name: Prepare toolchain [apt]
522+
if: ${{ matrix.packager == 'apt' }}
523+
run: |
524+
sudo apt-get update
525+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
526+
527+
- name: Prepare toolchain [brew]
528+
if: ${{ matrix.packager == 'brew' }}
529+
run: |
530+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
531+
532+
- name: Denormalize parameterization
533+
shell: bash
534+
run: |
535+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
536+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
537+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
538+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
539+
fi
540+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
541+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
542+
else
543+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
544+
fi
545+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
546+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
547+
else
548+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
549+
fi
550+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
551+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/${{ matrix.preset }}/lib" >> $GITHUB_ENV
552+
fi
553+
554+
- name: Execute install-cmakepresets.sh
555+
run: >
556+
./install-cmakepresets.sh
557+
--build-dir=$LIBBITCOIN_SRC_PATH
558+
--prefix=$LIBBITCOIN_SRC_PATH/prefix/${{ matrix.preset }}
559+
--preset=${{ matrix.preset }}
560+
${{ env.LINKAGE }}
561+
${{ env.ASSERT_NDEBUG }}
562+
${{ matrix.boost }}
563+
${{ matrix.icu }}
564+
${{ matrix.zmq }}
565+
566+
- name: Coveralls Calculation
567+
if: ${{ matrix.coverage == 'cov' }}
568+
run: |
569+
lcov --directory . --capture --output-file coverage.info
570+
lcov --remove coverage.info "/usr/*" "../prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
378571
lcov --list coverage.info
379572
380573
- name: Coveralls.io Upload

0 commit comments

Comments
 (0)