Skip to content

Commit e23420e

Browse files
authored
Merge pull request #346 from pmienk/version3
Regenerate with CMakePresets.
2 parents ccccefe + ff291bf commit e23420e

File tree

5 files changed

+1541
-47
lines changed

5 files changed

+1541
-47
lines changed

.github/workflows/ci.yml

Lines changed: 212 additions & 23 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"
@@ -30,7 +30,7 @@ jobs:
3030
packager: "apt"
3131
packages: ""
3232

33-
- os: ubuntu-latest
33+
- os: ubuntu-20.04
3434
cxx: "clang++"
3535
link: "static"
3636
optimization: "size"
@@ -43,7 +43,7 @@ jobs:
4343
packager: "apt"
4444
packages: ""
4545

46-
- os: ubuntu-latest
46+
- os: ubuntu-20.04
4747
cxx: "g++"
4848
link: "dynamic"
4949
optimization: "size"
@@ -56,7 +56,7 @@ jobs:
5656
packager: "apt"
5757
packages: ""
5858

59-
- os: ubuntu-latest
59+
- os: ubuntu-20.04
6060
cxx: "g++"
6161
link: "static"
6262
optimization: "debug"
@@ -125,7 +125,10 @@ jobs:
125125
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
126126
127127
- name: Denormalize parameterization
128+
shell: bash
128129
run: |
130+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-database}"
131+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
129132
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
130133
echo "ASSERT_NDEBUG=--enable-ndebug" >> $GITHUB_ENV
131134
else
@@ -137,15 +140,15 @@ jobs:
137140
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
138141
fi
139142
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
140-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
143+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
141144
fi
142145
143146
- name: Execute install.sh
144147
run: >
145148
./install.sh
146149
--enable-isystem
147-
--build-dir=${{ github.workspace }}/build
148-
--prefix=${{ github.workspace }}/prefixenv
150+
--build-dir=$LIBBITCOIN_SRC_PATH
151+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
149152
${{ env.LINKAGE }}
150153
${{ env.ASSERT_NDEBUG }}
151154
${{ matrix.boost }}
@@ -155,7 +158,7 @@ jobs:
155158
if: ${{ matrix.coverage == 'cov' }}
156159
run: |
157160
lcov --directory . --capture --output-file coverage.info
158-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
161+
lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
159162
lcov --list coverage.info
160163
161164
- name: Coveralls.io Upload
@@ -190,7 +193,7 @@ jobs:
190193
- name: Failure list libdir
191194
if: ${{ failure() }}
192195
run: |
193-
ls -la ${{ github.workspace }}/prefixenv/lib
196+
ls -la ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib
194197
195198
- name: Failure display boost bootstrap.log [--build-boost]
196199
if: ${{ failure() && (matrix.boost == '--build-boost') }}
@@ -210,8 +213,8 @@ jobs:
210213
- name: Failure display pkgconfig
211214
if: ${{ failure() }}
212215
run: |
213-
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
214-
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
216+
ls ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/
217+
cat ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/*.pc
215218
216219
cmake:
217220

@@ -220,7 +223,7 @@ jobs:
220223

221224
matrix:
222225
include:
223-
- os: ubuntu-latest
226+
- os: ubuntu-20.04
224227
cxx: "clang++"
225228
link: "dynamic"
226229
optimization: "size"
@@ -233,7 +236,7 @@ jobs:
233236
packager: "apt"
234237
packages: ""
235238

236-
- os: ubuntu-latest
239+
- os: ubuntu-20.04
237240
cxx: "clang++"
238241
link: "static"
239242
optimization: "size"
@@ -246,7 +249,7 @@ jobs:
246249
packager: "apt"
247250
packages: ""
248251

249-
- os: ubuntu-latest
252+
- os: ubuntu-20.04
250253
cxx: "g++"
251254
link: "dynamic"
252255
optimization: "size"
@@ -259,7 +262,7 @@ jobs:
259262
packager: "apt"
260263
packages: ""
261264

262-
- os: ubuntu-latest
265+
- os: ubuntu-20.04
263266
cxx: "g++"
264267
link: "static"
265268
optimization: "debug"
@@ -328,7 +331,10 @@ jobs:
328331
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
329332
330333
- name: Denormalize parameterization
334+
shell: bash
331335
run: |
336+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-database}"
337+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
332338
if [[ ${{ matrix.packager }} == 'brew' ]]; then
333339
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
334340
fi
@@ -343,14 +349,14 @@ jobs:
343349
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
344350
fi
345351
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
346-
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
352+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
347353
fi
348354
349355
- name: Execute install-cmake.sh
350356
run: >
351357
./install-cmake.sh
352-
--build-dir=${{ github.workspace }}/build
353-
--prefix=${{ github.workspace }}/prefixenv
358+
--build-dir=$LIBBITCOIN_SRC_PATH
359+
--prefix=$LIBBITCOIN_SRC_PATH/prefix
354360
${{ env.LINKAGE }}
355361
${{ env.ASSERT_NDEBUG }}
356362
${{ matrix.boost }}
@@ -360,7 +366,7 @@ jobs:
360366
if: ${{ matrix.coverage == 'cov' }}
361367
run: |
362368
lcov --directory . --capture --output-file coverage.info
363-
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
369+
lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
364370
lcov --list coverage.info
365371
366372
- name: Coveralls.io Upload
@@ -395,7 +401,7 @@ jobs:
395401
- name: Failure list libdir
396402
if: ${{ failure() }}
397403
run: |
398-
ls -la ${{ github.workspace }}/prefixenv/lib
404+
ls -la ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib
399405
400406
- name: Failure display boost bootstrap.log [--build-boost]
401407
if: ${{ failure() && (matrix.boost == '--build-boost') }}
@@ -415,13 +421,196 @@ jobs:
415421
- name: Failure display pkgconfig
416422
if: ${{ failure() }}
417423
run: |
418-
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
419-
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
424+
ls ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/
425+
cat ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/*.pc
420426
421427
- name: Failure display cmake specific libraries
422428
if: ${{ failure() }}
423429
run: |
424-
ls ${{ github.workspace }}/prefixenv/lib/cmake
430+
ls ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/cmake
431+
432+
- name: Failure display cmake LastTest.log
433+
if: ${{ failure() }}
434+
run: |
435+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
436+
437+
preset:
438+
439+
strategy:
440+
fail-fast: false
441+
442+
matrix:
443+
include:
444+
- os: ubuntu-20.04
445+
preset: "nix-gnu-debug-shared"
446+
cxx: "clang++"
447+
link: "dynamic"
448+
optimization: "size"
449+
assert: "debug"
450+
coverage: "nocov"
451+
boost: "--build-boost"
452+
icu: ""
453+
cc: "clang"
454+
flags: "-Os -fPIE"
455+
packager: "apt"
456+
packages: ""
457+
458+
- os: ubuntu-20.04
459+
preset: "nix-gnu-release-static-size"
460+
cxx: "clang++"
461+
link: "static"
462+
optimization: "size"
463+
assert: "ndebug"
464+
coverage: "nocov"
465+
boost: "--build-boost"
466+
icu: "--build-icu --with-icu"
467+
cc: "clang"
468+
flags: "-Os -fPIE"
469+
packager: "apt"
470+
packages: ""
471+
472+
- os: ubuntu-20.04
473+
preset: "nix-gnu-release-shared-size"
474+
cxx: "g++"
475+
link: "dynamic"
476+
optimization: "size"
477+
assert: "ndebug"
478+
coverage: "nocov"
479+
boost: "--build-boost"
480+
icu: ""
481+
cc: "gcc"
482+
flags: "-Os -fPIE"
483+
packager: "apt"
484+
packages: ""
485+
486+
487+
runs-on: ${{ matrix.os }}
488+
489+
env:
490+
CC: '${{ matrix.cc }}'
491+
CXX: '${{ matrix.cxx }}'
492+
CFLAGS: '${{ matrix.flags }}'
493+
CXXFLAGS: '${{ matrix.flags }}'
494+
CI_REPOSITORY: '${{ github.repository }}'
495+
496+
steps:
497+
- name: Checkout repository
498+
uses: actions/checkout@v3
499+
500+
- name: Prepare toolchain [generic]
501+
run: |
502+
git config --global init.defaultBranch master
503+
504+
- name: Prepare toolchain [apt]
505+
if: ${{ matrix.packager == 'apt' }}
506+
run: |
507+
sudo apt-get update
508+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
509+
510+
- name: Prepare toolchain [brew]
511+
if: ${{ matrix.packager == 'brew' }}
512+
run: |
513+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
514+
515+
- name: Denormalize parameterization
516+
shell: bash
517+
run: |
518+
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-database}"
519+
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
520+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
521+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
522+
fi
523+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
524+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
525+
else
526+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
527+
fi
528+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
529+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
530+
else
531+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
532+
fi
533+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
534+
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/${{ matrix.preset }}/lib" >> $GITHUB_ENV
535+
fi
536+
537+
- name: Execute install-cmakepresets.sh
538+
run: >
539+
./install-cmakepresets.sh
540+
--build-dir=$LIBBITCOIN_SRC_PATH
541+
--prefix=$LIBBITCOIN_SRC_PATH/prefix/${{ matrix.preset }}
542+
--preset=${{ matrix.preset }}
543+
${{ env.LINKAGE }}
544+
${{ env.ASSERT_NDEBUG }}
545+
${{ matrix.boost }}
546+
${{ matrix.icu }}
547+
548+
- name: Coveralls Calculation
549+
if: ${{ matrix.coverage == 'cov' }}
550+
run: |
551+
lcov --directory . --capture --output-file coverage.info
552+
lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
553+
lcov --list coverage.info
554+
555+
- name: Coveralls.io Upload
556+
if: ${{ matrix.coverage == 'cov' }}
557+
uses: pmienk/coveralls-github-action@master
558+
with:
559+
path-to-lcov: "./coverage.info"
560+
github-token: ${{ secrets.github_token }}
561+
562+
- name: Failure display available binaries
563+
if: ${{ failure() }}
564+
run: |
565+
ls -la /usr/bin
566+
567+
- name: Failure display selected compiler version
568+
if: ${{ failure() }}
569+
run: |
570+
${CC} -v
571+
${CXX} -v
572+
573+
- name: Failure display default compiler version
574+
if: ${{ failure() }}
575+
run: |
576+
clang -v
577+
gcc -v
578+
579+
- name: Failure display env
580+
if: ${{ failure() }}
581+
run: |
582+
env
583+
584+
- name: Failure list libdir
585+
if: ${{ failure() }}
586+
run: |
587+
ls -la ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib
588+
589+
- name: Failure display boost bootstrap.log [--build-boost]
590+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
591+
run: |
592+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
593+
594+
- name: Failure display otool output
595+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
596+
run: |
597+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-database-test
598+
599+
- name: Failure display DYLD_PRINT_LIBRARIES
600+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
601+
run: |
602+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-database-test
603+
604+
- name: Failure display pkgconfig
605+
if: ${{ failure() }}
606+
run: |
607+
ls ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/
608+
cat ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/pkgconfig/*.pc
609+
610+
- name: Failure display cmake specific libraries
611+
if: ${{ failure() }}
612+
run: |
613+
ls ${{ env.LIBBITCOIN_SRC_PATH }}prefix/lib/cmake
425614
426615
- name: Failure display cmake LastTest.log
427616
if: ${{ failure() }}

0 commit comments

Comments
 (0)