Skip to content

Commit 324ca2a

Browse files
authored
Merge pull request #553 from pmienk/install-cmake-v3
Add cmake builds to CI.
2 parents cdb461c + fb4dd55 commit 324ca2a

4 files changed

Lines changed: 1500 additions & 131 deletions

File tree

.github/workflows/ci.yml

Lines changed: 249 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Continuous Integration Build
1010
on: [ pull_request, push, workflow_dispatch ]
1111

1212
jobs:
13-
verify-installsh:
13+
autotools:
1414

1515
strategy:
1616
fail-fast: false
@@ -20,6 +20,7 @@ jobs:
2020
- os: ubuntu-latest
2121
cxx: "clang++"
2222
link: "dynamic"
23+
optimization: "size"
2324
assert: "debug"
2425
coverage: "nocov"
2526
boost: "--build-boost"
@@ -29,11 +30,12 @@ jobs:
2930
cc: "clang"
3031
flags: "-Os -fPIE"
3132
packager: "apt"
32-
packages: "clang"
33+
packages: ""
3334

3435
- os: ubuntu-latest
3536
cxx: "clang++"
3637
link: "static"
38+
optimization: "size"
3739
assert: "ndebug"
3840
coverage: "nocov"
3941
boost: "--build-boost"
@@ -43,11 +45,12 @@ jobs:
4345
cc: "clang"
4446
flags: "-Os -fPIE"
4547
packager: "apt"
46-
packages: "clang"
48+
packages: ""
4749

4850
- os: ubuntu-latest
4951
cxx: "g++"
5052
link: "dynamic"
53+
optimization: "size"
5154
assert: "ndebug"
5255
coverage: "nocov"
5356
boost: "--build-boost"
@@ -57,11 +60,12 @@ jobs:
5760
cc: "gcc"
5861
flags: "-Os -fPIE"
5962
packager: "apt"
60-
packages: "gcc"
63+
packages: ""
6164

6265
- os: ubuntu-latest
6366
cxx: "g++"
6467
link: "static"
68+
optimization: "debug"
6569
assert: "ndebug"
6670
coverage: "nocov"
6771
boost: "--build-boost"
@@ -71,11 +75,12 @@ jobs:
7175
cc: "gcc"
7276
flags: "-Og -fPIE"
7377
packager: "apt"
74-
packages: "gcc"
78+
packages: ""
7579

7680
- os: macos-latest
7781
cxx: "clang++"
7882
link: "dynamic"
83+
optimization: "size"
7984
assert: "ndebug"
8085
coverage: "nocov"
8186
boost: "--build-boost"
@@ -90,6 +95,7 @@ jobs:
9095
- os: macos-latest
9196
cxx: "clang++"
9297
link: "static"
98+
optimization: "size"
9399
assert: "ndebug"
94100
coverage: "nocov"
95101
boost: "--build-boost"
@@ -101,6 +107,7 @@ jobs:
101107
packager: "brew"
102108
packages: ""
103109

110+
104111
runs-on: ${{ matrix.os }}
105112

106113
env:
@@ -167,6 +174,226 @@ jobs:
167174
path-to-lcov: "./coverage.info"
168175
github-token: ${{ secrets.github_token }}
169176

177+
- name: Failure display available binaries
178+
if: ${{ failure() }}
179+
run: |
180+
ls -la /usr/bin
181+
182+
- name: Failure display selected compiler version
183+
if: ${{ failure() }}
184+
run: |
185+
${CC} -v
186+
${CXX} -v
187+
188+
- name: Failure display default compiler version
189+
if: ${{ failure() }}
190+
run: |
191+
clang -v
192+
gcc -v
193+
194+
- name: Failure display env
195+
if: ${{ failure() }}
196+
run: |
197+
env
198+
199+
- name: Failure list libdir
200+
if: ${{ failure() }}
201+
run: |
202+
ls -la ${{ github.workspace }}/prefixenv/lib
203+
204+
- name: Failure display boost bootstrap.log [--build-boost]
205+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
206+
run: |
207+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
208+
209+
- name: Failure display otool output
210+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
211+
run: |
212+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-server-test
213+
214+
- name: Failure display DYLD_PRINT_LIBRARIES
215+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
216+
run: |
217+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-server-test
218+
219+
- name: Failure display pkgconfig
220+
if: ${{ failure() }}
221+
run: |
222+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
223+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
224+
225+
cmake:
226+
227+
strategy:
228+
fail-fast: false
229+
230+
matrix:
231+
include:
232+
- os: ubuntu-latest
233+
cxx: "clang++"
234+
link: "dynamic"
235+
optimization: "size"
236+
assert: "debug"
237+
coverage: "nocov"
238+
boost: "--build-boost"
239+
consensus: ""
240+
icu: ""
241+
zmq: "--build-zmq"
242+
cc: "clang"
243+
flags: "-Os -fPIE"
244+
packager: "apt"
245+
packages: ""
246+
247+
- os: ubuntu-latest
248+
cxx: "clang++"
249+
link: "static"
250+
optimization: "size"
251+
assert: "ndebug"
252+
coverage: "nocov"
253+
boost: "--build-boost"
254+
consensus: ""
255+
icu: "--build-icu --with-icu"
256+
zmq: "--build-zmq"
257+
cc: "clang"
258+
flags: "-Os -fPIE"
259+
packager: "apt"
260+
packages: ""
261+
262+
- os: ubuntu-latest
263+
cxx: "g++"
264+
link: "dynamic"
265+
optimization: "size"
266+
assert: "ndebug"
267+
coverage: "nocov"
268+
boost: "--build-boost"
269+
consensus: "-Dwith-consensus=no"
270+
icu: ""
271+
zmq: "--build-zmq"
272+
cc: "gcc"
273+
flags: "-Os -fPIE"
274+
packager: "apt"
275+
packages: ""
276+
277+
- os: ubuntu-latest
278+
cxx: "g++"
279+
link: "static"
280+
optimization: "debug"
281+
assert: "ndebug"
282+
coverage: "nocov"
283+
boost: "--build-boost"
284+
consensus: ""
285+
icu: "--build-icu --with-icu"
286+
zmq: "--build-zmq"
287+
cc: "gcc"
288+
flags: "-Og -fPIE"
289+
packager: "apt"
290+
packages: ""
291+
292+
- os: macos-latest
293+
cxx: "clang++"
294+
link: "dynamic"
295+
optimization: "size"
296+
assert: "ndebug"
297+
coverage: "nocov"
298+
boost: "--build-boost"
299+
consensus: ""
300+
icu: "--build-icu --with-icu"
301+
zmq: "--build-zmq"
302+
cc: "clang"
303+
flags: "-Os -fPIE"
304+
packager: "brew"
305+
packages: ""
306+
307+
- os: macos-latest
308+
cxx: "clang++"
309+
link: "static"
310+
optimization: "size"
311+
assert: "ndebug"
312+
coverage: "nocov"
313+
boost: "--build-boost"
314+
consensus: "-Dwith-consensus=no"
315+
icu: "--build-icu --with-icu"
316+
zmq: "--build-zmq"
317+
cc: "clang"
318+
flags: "-Os -fvisibility=hidden -fPIE"
319+
packager: "brew"
320+
packages: ""
321+
322+
323+
runs-on: ${{ matrix.os }}
324+
325+
env:
326+
CC: '${{ matrix.cc }}'
327+
CXX: '${{ matrix.cxx }}'
328+
CFLAGS: '${{ matrix.flags }}'
329+
CXXFLAGS: '${{ matrix.flags }}'
330+
CI_REPOSITORY: '${{ github.repository }}'
331+
332+
steps:
333+
- name: Checkout repository
334+
uses: actions/checkout@v2
335+
336+
- name: Prepare toolchain [apt]
337+
if: ${{ matrix.packager == 'apt' }}
338+
run: |
339+
sudo apt-get update
340+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
341+
342+
- name: Prepare toolchain [brew]
343+
if: ${{ matrix.packager == 'brew' }}
344+
run: |
345+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
346+
347+
- name: Denormalize parameterization
348+
run: |
349+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
350+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
351+
fi
352+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
353+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
354+
else
355+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
356+
fi
357+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
358+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
359+
else
360+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
361+
fi
362+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
363+
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
364+
fi
365+
366+
- name: Execute install-cmake.sh
367+
run: >
368+
./install-cmake.sh
369+
--build-dir=${{ github.workspace }}/build
370+
--prefix=${{ github.workspace }}/prefixenv
371+
${{ env.LINKAGE }}
372+
${{ env.ASSERT_NDEBUG }}
373+
${{ matrix.boost }}
374+
${{ matrix.icu }}
375+
${{ matrix.consensus }}
376+
${{ matrix.zmq }}
377+
378+
- name: Coveralls Calculation
379+
if: ${{ matrix.coverage == 'cov' }}
380+
run: |
381+
lcov --directory . --capture --output-file coverage.info
382+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
383+
lcov --list coverage.info
384+
385+
- name: Coveralls.io Upload
386+
if: ${{ matrix.coverage == 'cov' }}
387+
uses: coverallsapp/github-action@master
388+
with:
389+
path-to-lcov: "./coverage.info"
390+
github-token: ${{ secrets.github_token }}
391+
392+
- name: Failure display available binaries
393+
if: ${{ failure() }}
394+
run: |
395+
ls -la /usr/bin
396+
170397
- name: Failure display selected compiler version
171398
if: ${{ failure() }}
172399
run: |
@@ -204,7 +431,23 @@ jobs:
204431
run: |
205432
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-server-test
206433
207-
verify-sln:
434+
- name: Failure display pkgconfig
435+
if: ${{ failure() }}
436+
run: |
437+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
438+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
439+
440+
- name: Failure display cmake specific libraries
441+
if: ${{ failure() }}
442+
run: |
443+
ls ${{ github.workspace }}/prefixenv/lib/cmake
444+
445+
- name: Failure display cmake LastTest.log
446+
if: ${{ failure() }}
447+
run: |
448+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
449+
450+
msbuild:
208451
strategy:
209452
fail-fast: false
210453

builds/cmake/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else ()
3030
set( libdir "\${exec_prefix}/lib" )
3131
set( includedir "\${exec_prefix}/include" )
3232

33-
set( PACKAGE_VERSION "4.0.0" )
33+
set( PACKAGE_VERSION "3.7.0" )
3434
set( VERSION "${PACKAGE_VERSION}" )
3535
endif ()
3636

@@ -60,6 +60,9 @@ add_compile_options( "-Wno-missing-braces" )
6060
# Ignore comments within comments or commenting of backslash extended lines.
6161
add_compile_options( "-Wno-comment" )
6262

63+
# Suppress warning for copy of implicitly generated copy constructor.
64+
add_compile_options( "-Wno-deprecated-copy" )
65+
6366
# Conflict in stdlib under clang.
6467
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
6568
add_compile_options( "-Wno-mismatched-tags" )
@@ -95,6 +98,12 @@ if (BUILD_SHARED_LIBS)
9598
add_definitions( -DBOOST_ALL_DYN_LINK )
9699
endif()
97100

101+
if (BUILD_SHARED_LIBS)
102+
set( Boost_USE_STATIC_LIBS "off" )
103+
else()
104+
set( Boost_USE_STATIC_LIBS "on" )
105+
endif()
106+
98107
# Find boost
99108
#------------------------------------------------------------------------------
100109
find_package( Boost 1.72.0 REQUIRED COMPONENTS
@@ -119,11 +128,11 @@ endif()
119128

120129
# Find bitcoin-node
121130
#------------------------------------------------------------------------------
122-
find_package( Bitcoin-Node 4.0.0 REQUIRED )
131+
find_package( Bitcoin-Node 3.7.0 REQUIRED )
123132

124133
# Find bitcoin-protocol
125134
#------------------------------------------------------------------------------
126-
find_package( Bitcoin-Protocol 4.0.0 REQUIRED )
135+
find_package( Bitcoin-Protocol 3.7.0 REQUIRED )
127136

128137
# Define project common includes directories
129138
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)