Skip to content

Commit 3c665fa

Browse files
authored
Merge pull request #246 from pmienk/version3
Regenerate with CMakePresets.
2 parents 1ed2b05 + 95dac61 commit 3c665fa

5 files changed

Lines changed: 1568 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 213 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
matrix:
1919
include:
20-
- os: ubuntu-latest
20+
- os: ubuntu-20.04
2121
cxx: "clang++"
2222
link: "dynamic"
2323
optimization: "size"
@@ -32,7 +32,7 @@ jobs:
3232
packager: "apt"
3333
packages: ""
3434

35-
- os: ubuntu-latest
35+
- os: ubuntu-20.04
3636
cxx: "clang++"
3737
link: "static"
3838
optimization: "size"
@@ -47,7 +47,7 @@ jobs:
4747
packager: "apt"
4848
packages: ""
4949

50-
- os: ubuntu-latest
50+
- os: ubuntu-20.04
5151
cxx: "g++"
5252
link: "dynamic"
5353
optimization: "size"
@@ -62,7 +62,7 @@ jobs:
6262
packager: "apt"
6363
packages: ""
6464

65-
- os: ubuntu-latest
65+
- os: ubuntu-20.04
6666
cxx: "g++"
6767
link: "static"
6868
optimization: "debug"
@@ -137,7 +137,10 @@ jobs:
137137
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
138138
139139
- name: Denormalize parameterization
140+
shell: bash
140141
run: |
142+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
143+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
141144
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
142145
echo "ASSERT_NDEBUG=--enable-ndebug" >> $GITHUB_ENV
143146
else
@@ -149,15 +152,15 @@ jobs:
149152
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
150153
fi
151154
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
152-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
155+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
153156
fi
154157
155158
- name: Execute install.sh
156159
run: >
157160
./install.sh
158161
--enable-isystem
159-
--build-dir=${{ github.workspace }}/build
160-
--prefix=${{ github.workspace }}/prefixenv
162+
--build-dir=$LIBBITCOIN_SRC_PATH
163+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
161164
${{ env.LINKAGE }}
162165
${{ env.ASSERT_NDEBUG }}
163166
${{ matrix.boost }}
@@ -169,7 +172,7 @@ jobs:
169172
if: ${{ matrix.coverage == 'cov' }}
170173
run: |
171174
lcov --directory . --capture --output-file coverage.info
172-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/interface.pb.*" --output-file coverage.info
175+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefix/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/interface.pb.*" --output-file coverage.info
173176
lcov --list coverage.info
174177
175178
- name: Coveralls.io Upload
@@ -234,7 +237,7 @@ jobs:
234237

235238
matrix:
236239
include:
237-
- os: ubuntu-latest
240+
- os: ubuntu-20.04
238241
cxx: "clang++"
239242
link: "dynamic"
240243
optimization: "size"
@@ -249,7 +252,7 @@ jobs:
249252
packager: "apt"
250253
packages: ""
251254

252-
- os: ubuntu-latest
255+
- os: ubuntu-20.04
253256
cxx: "clang++"
254257
link: "static"
255258
optimization: "size"
@@ -264,7 +267,7 @@ jobs:
264267
packager: "apt"
265268
packages: ""
266269

267-
- os: ubuntu-latest
270+
- os: ubuntu-20.04
268271
cxx: "g++"
269272
link: "dynamic"
270273
optimization: "size"
@@ -279,7 +282,7 @@ jobs:
279282
packager: "apt"
280283
packages: ""
281284

282-
- os: ubuntu-latest
285+
- os: ubuntu-20.04
283286
cxx: "g++"
284287
link: "static"
285288
optimization: "debug"
@@ -354,7 +357,10 @@ jobs:
354357
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
355358
356359
- name: Denormalize parameterization
360+
shell: bash
357361
run: |
362+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
363+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
358364
if [[ ${{ matrix.packager }} == 'brew' ]]; then
359365
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
360366
fi
@@ -369,14 +375,14 @@ jobs:
369375
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
370376
fi
371377
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
372-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
378+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
373379
fi
374380
375381
- name: Execute install-cmake.sh
376382
run: >
377383
./install-cmake.sh
378-
--build-dir=${{ github.workspace }}/build
379-
--prefix=${{ github.workspace }}/prefixenv
384+
--build-dir=$LIBBITCOIN_SRC_PATH
385+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
380386
${{ env.LINKAGE }}
381387
${{ env.ASSERT_NDEBUG }}
382388
${{ matrix.boost }}
@@ -388,7 +394,198 @@ jobs:
388394
if: ${{ matrix.coverage == 'cov' }}
389395
run: |
390396
lcov --directory . --capture --output-file coverage.info
391-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/interface.pb.*" --output-file coverage.info
397+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefix/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/interface.pb.*" --output-file coverage.info
398+
lcov --list coverage.info
399+
400+
- name: Coveralls.io Upload
401+
if: ${{ matrix.coverage == 'cov' }}
402+
uses: pmienk/coveralls-github-action@master
403+
with:
404+
path-to-lcov: "./coverage.info"
405+
github-token: ${{ secrets.github_token }}
406+
407+
- name: Failure display available binaries
408+
if: ${{ failure() }}
409+
run: |
410+
ls -la /usr/bin
411+
412+
- name: Failure display selected compiler version
413+
if: ${{ failure() }}
414+
run: |
415+
${CC} -v
416+
${CXX} -v
417+
418+
- name: Failure display default compiler version
419+
if: ${{ failure() }}
420+
run: |
421+
clang -v
422+
gcc -v
423+
424+
- name: Failure display env
425+
if: ${{ failure() }}
426+
run: |
427+
env
428+
429+
- name: Failure list libdir
430+
if: ${{ failure() }}
431+
run: |
432+
ls -la ${{ github.workspace }}/prefixenv/lib
433+
434+
- name: Failure display boost bootstrap.log [--build-boost]
435+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
436+
run: |
437+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
438+
439+
- name: Failure display otool output
440+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
441+
run: |
442+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-protocol-test
443+
444+
- name: Failure display DYLD_PRINT_LIBRARIES
445+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
446+
run: |
447+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-protocol-test
448+
449+
- name: Failure display pkgconfig
450+
if: ${{ failure() }}
451+
run: |
452+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
453+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
454+
455+
- name: Failure display cmake specific libraries
456+
if: ${{ failure() }}
457+
run: |
458+
ls ${{ github.workspace }}/prefixenv/lib/cmake
459+
460+
- name: Failure display cmake LastTest.log
461+
if: ${{ failure() }}
462+
run: |
463+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
464+
465+
preset:
466+
467+
strategy:
468+
fail-fast: false
469+
470+
matrix:
471+
include:
472+
- os: ubuntu-20.04
473+
preset: "nix-gnu-debug-shared"
474+
cxx: "clang++"
475+
link: "dynamic"
476+
optimization: "size"
477+
assert: "debug"
478+
coverage: "nocov"
479+
boost: "--build-boost"
480+
icu: ""
481+
mbedtls: "--build-mbedtls"
482+
zmq: "--build-zmq"
483+
cc: "clang"
484+
flags: "-Os -fPIE"
485+
packager: "apt"
486+
packages: ""
487+
488+
- os: ubuntu-20.04
489+
preset: "nix-gnu-release-static-size"
490+
cxx: "clang++"
491+
link: "static"
492+
optimization: "size"
493+
assert: "ndebug"
494+
coverage: "nocov"
495+
boost: "--build-boost"
496+
icu: "--build-icu --with-icu"
497+
mbedtls: ""
498+
zmq: "--build-zmq"
499+
cc: "clang"
500+
flags: "-Os -fPIE"
501+
packager: "apt"
502+
packages: ""
503+
504+
- os: ubuntu-20.04
505+
preset: "nix-gnu-release-shared-size"
506+
cxx: "g++"
507+
link: "dynamic"
508+
optimization: "size"
509+
assert: "ndebug"
510+
coverage: "nocov"
511+
boost: "--build-boost"
512+
icu: ""
513+
mbedtls: ""
514+
zmq: "--build-zmq"
515+
cc: "gcc"
516+
flags: "-Os -fPIE"
517+
packager: "apt"
518+
packages: ""
519+
520+
521+
runs-on: ${{ matrix.os }}
522+
523+
env:
524+
CC: '${{ matrix.cc }}'
525+
CXX: '${{ matrix.cxx }}'
526+
CFLAGS: '${{ matrix.flags }}'
527+
CXXFLAGS: '${{ matrix.flags }}'
528+
CI_REPOSITORY: '${{ github.repository }}'
529+
530+
steps:
531+
- name: Checkout repository
532+
uses: actions/checkout@v3
533+
534+
- name: Prepare toolchain [generic]
535+
run: |
536+
git config --global init.defaultBranch master
537+
538+
- name: Prepare toolchain [apt]
539+
if: ${{ matrix.packager == 'apt' }}
540+
run: |
541+
sudo apt-get update
542+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
543+
544+
- name: Prepare toolchain [brew]
545+
if: ${{ matrix.packager == 'brew' }}
546+
run: |
547+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
548+
549+
- name: Denormalize parameterization
550+
shell: bash
551+
run: |
552+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-protocol}"
553+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
554+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
555+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
556+
fi
557+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
558+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
559+
else
560+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
561+
fi
562+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
563+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
564+
else
565+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
566+
fi
567+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
568+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/${{ matrix.preset }}/lib" >> $GITHUB_ENV
569+
fi
570+
571+
- name: Execute install-cmakepresets.sh
572+
run: >
573+
./install-cmakepresets.sh
574+
--build-dir=$LIBBITCOIN_SRC_PATH
575+
--prefix=$LIBBITCOIN_SRC_PATH/prefix/${{ matrix.preset }}
576+
--preset=${{ matrix.preset }}
577+
${{ env.LINKAGE }}
578+
${{ env.ASSERT_NDEBUG }}
579+
${{ matrix.boost }}
580+
${{ matrix.icu }}
581+
${{ matrix.mbedtls }}
582+
${{ matrix.zmq }}
583+
584+
- name: Coveralls Calculation
585+
if: ${{ matrix.coverage == 'cov' }}
586+
run: |
587+
lcov --directory . --capture --output-file coverage.info
588+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefix/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/interface.pb.*" --output-file coverage.info
392589
lcov --list coverage.info
393590
394591
- name: Coveralls.io Upload

0 commit comments

Comments
 (0)