Skip to content

Commit 2a7f0cf

Browse files
authored
Merge pull request #293 from pmienk/install-cmake-v3
Add cmake builds to CI.
2 parents e484b17 + 3fe2255 commit 2a7f0cf

5 files changed

Lines changed: 1407 additions & 126 deletions

File tree

.github/workflows/ci.yml

Lines changed: 238 additions & 7 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,54 +20,59 @@ jobs:
2020
- os: ubuntu-latest
2121
cxx: "clang++"
2222
link: "dynamic"
23+
optimization: "size"
2324
assert: "debug"
2425
coverage: "nocov"
2526
boost: "--build-boost"
2627
icu: ""
2728
cc: "clang"
2829
flags: "-Os -fPIE"
2930
packager: "apt"
30-
packages: "clang"
31+
packages: ""
3132

3233
- os: ubuntu-latest
3334
cxx: "clang++"
3435
link: "static"
36+
optimization: "size"
3537
assert: "ndebug"
3638
coverage: "nocov"
3739
boost: "--build-boost"
3840
icu: "--build-icu --with-icu"
3941
cc: "clang"
4042
flags: "-Os -fPIE"
4143
packager: "apt"
42-
packages: "clang"
44+
packages: ""
4345

4446
- os: ubuntu-latest
4547
cxx: "g++"
4648
link: "dynamic"
49+
optimization: "size"
4750
assert: "ndebug"
4851
coverage: "nocov"
4952
boost: "--build-boost"
5053
icu: ""
5154
cc: "gcc"
5255
flags: "-Os -fPIE"
5356
packager: "apt"
54-
packages: "gcc"
57+
packages: ""
5558

5659
- os: ubuntu-latest
5760
cxx: "g++"
5861
link: "static"
62+
optimization: "debug"
5963
assert: "ndebug"
6064
coverage: "cov"
6165
boost: "--build-boost"
6266
icu: "--build-icu --with-icu"
6367
cc: "gcc"
6468
flags: "-Og -g --coverage -fPIE"
6569
packager: "apt"
66-
packages: "gcc lcov"
70+
packages: "lcov"
6771

6872
- os: macos-latest
6973
cxx: "clang++"
7074
link: "dynamic"
75+
optimization: "size"
7176
assert: "ndebug"
7277
coverage: "nocov"
7378
boost: "--build-boost"
@@ -80,6 +85,7 @@ jobs:
8085
- os: macos-latest
8186
cxx: "clang++"
8287
link: "static"
88+
optimization: "size"
8389
assert: "ndebug"
8490
coverage: "nocov"
8591
boost: "--build-boost"
@@ -89,6 +95,7 @@ jobs:
8995
packager: "brew"
9096
packages: ""
9197

98+
9299
runs-on: ${{ matrix.os }}
93100

94101
env:
@@ -153,6 +160,212 @@ jobs:
153160
path-to-lcov: "./coverage.info"
154161
github-token: ${{ secrets.github_token }}
155162

163+
- name: Failure display available binaries
164+
if: ${{ failure() }}
165+
run: |
166+
ls -la /usr/bin
167+
168+
- name: Failure display selected compiler version
169+
if: ${{ failure() }}
170+
run: |
171+
${CC} -v
172+
${CXX} -v
173+
174+
- name: Failure display default compiler version
175+
if: ${{ failure() }}
176+
run: |
177+
clang -v
178+
gcc -v
179+
180+
- name: Failure display env
181+
if: ${{ failure() }}
182+
run: |
183+
env
184+
185+
- name: Failure list libdir
186+
if: ${{ failure() }}
187+
run: |
188+
ls -la ${{ github.workspace }}/prefixenv/lib
189+
190+
- name: Failure display boost bootstrap.log [--build-boost]
191+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
192+
run: |
193+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
194+
195+
- name: Failure display otool output
196+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
197+
run: |
198+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-database-test
199+
200+
- name: Failure display DYLD_PRINT_LIBRARIES
201+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
202+
run: |
203+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-database-test
204+
205+
- name: Failure display pkgconfig
206+
if: ${{ failure() }}
207+
run: |
208+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
209+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
210+
211+
cmake:
212+
213+
strategy:
214+
fail-fast: false
215+
216+
matrix:
217+
include:
218+
- os: ubuntu-latest
219+
cxx: "clang++"
220+
link: "dynamic"
221+
optimization: "size"
222+
assert: "debug"
223+
coverage: "nocov"
224+
boost: "--build-boost"
225+
icu: ""
226+
cc: "clang"
227+
flags: "-Os -fPIE"
228+
packager: "apt"
229+
packages: ""
230+
231+
- os: ubuntu-latest
232+
cxx: "clang++"
233+
link: "static"
234+
optimization: "size"
235+
assert: "ndebug"
236+
coverage: "nocov"
237+
boost: "--build-boost"
238+
icu: "--build-icu --with-icu"
239+
cc: "clang"
240+
flags: "-Os -fPIE"
241+
packager: "apt"
242+
packages: ""
243+
244+
- os: ubuntu-latest
245+
cxx: "g++"
246+
link: "dynamic"
247+
optimization: "size"
248+
assert: "ndebug"
249+
coverage: "nocov"
250+
boost: "--build-boost"
251+
icu: ""
252+
cc: "gcc"
253+
flags: "-Os -fPIE"
254+
packager: "apt"
255+
packages: ""
256+
257+
- os: ubuntu-latest
258+
cxx: "g++"
259+
link: "static"
260+
optimization: "debug"
261+
assert: "ndebug"
262+
coverage: "nocov"
263+
boost: "--build-boost"
264+
icu: "--build-icu --with-icu"
265+
cc: "gcc"
266+
flags: "-Og -fPIE"
267+
packager: "apt"
268+
packages: ""
269+
270+
- os: macos-latest
271+
cxx: "clang++"
272+
link: "dynamic"
273+
optimization: "size"
274+
assert: "ndebug"
275+
coverage: "nocov"
276+
boost: "--build-boost"
277+
icu: "--build-icu --with-icu"
278+
cc: "clang"
279+
flags: "-Os -fPIE"
280+
packager: "brew"
281+
packages: ""
282+
283+
- os: macos-latest
284+
cxx: "clang++"
285+
link: "static"
286+
optimization: "size"
287+
assert: "ndebug"
288+
coverage: "nocov"
289+
boost: "--build-boost"
290+
icu: "--build-icu --with-icu"
291+
cc: "clang"
292+
flags: "-Os -fvisibility=hidden -fPIE"
293+
packager: "brew"
294+
packages: ""
295+
296+
297+
runs-on: ${{ matrix.os }}
298+
299+
env:
300+
CC: '${{ matrix.cc }}'
301+
CXX: '${{ matrix.cxx }}'
302+
CFLAGS: '${{ matrix.flags }}'
303+
CXXFLAGS: '${{ matrix.flags }}'
304+
CI_REPOSITORY: '${{ github.repository }}'
305+
306+
steps:
307+
- name: Checkout repository
308+
uses: actions/checkout@v2
309+
310+
- name: Prepare toolchain [apt]
311+
if: ${{ matrix.packager == 'apt' }}
312+
run: |
313+
sudo apt-get update
314+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
315+
316+
- name: Prepare toolchain [brew]
317+
if: ${{ matrix.packager == 'brew' }}
318+
run: |
319+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
320+
321+
- name: Denormalize parameterization
322+
run: |
323+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
324+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
325+
fi
326+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
327+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
328+
else
329+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
330+
fi
331+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
332+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
333+
else
334+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
335+
fi
336+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
337+
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
338+
fi
339+
340+
- name: Execute install-cmake.sh
341+
run: >
342+
./install-cmake.sh
343+
--build-dir=${{ github.workspace }}/build
344+
--prefix=${{ github.workspace }}/prefixenv
345+
${{ env.LINKAGE }}
346+
${{ env.ASSERT_NDEBUG }}
347+
${{ matrix.boost }}
348+
${{ matrix.icu }}
349+
350+
- name: Coveralls Calculation
351+
if: ${{ matrix.coverage == 'cov' }}
352+
run: |
353+
lcov --directory . --capture --output-file coverage.info
354+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
355+
lcov --list coverage.info
356+
357+
- name: Coveralls.io Upload
358+
if: ${{ matrix.coverage == 'cov' }}
359+
uses: coverallsapp/github-action@master
360+
with:
361+
path-to-lcov: "./coverage.info"
362+
github-token: ${{ secrets.github_token }}
363+
364+
- name: Failure display available binaries
365+
if: ${{ failure() }}
366+
run: |
367+
ls -la /usr/bin
368+
156369
- name: Failure display selected compiler version
157370
if: ${{ failure() }}
158371
run: |
@@ -190,7 +403,23 @@ jobs:
190403
run: |
191404
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-database-test
192405
193-
verify-sln:
406+
- name: Failure display pkgconfig
407+
if: ${{ failure() }}
408+
run: |
409+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
410+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
411+
412+
- name: Failure display cmake specific libraries
413+
if: ${{ failure() }}
414+
run: |
415+
ls ${{ github.workspace }}/prefixenv/lib/cmake
416+
417+
- name: Failure display cmake LastTest.log
418+
if: ${{ failure() }}
419+
run: |
420+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
421+
422+
msbuild:
194423
strategy:
195424
fail-fast: false
196425

@@ -200,11 +429,13 @@ jobs:
200429
configuration: "StaticDebug"
201430
platform: "x64"
202431
version: "vs2022"
432+
tests: "*"
203433

204434
- os: windows-latest
205435
configuration: "StaticRelease"
206436
platform: "x64"
207437
version: "vs2022"
438+
tests: "*"
208439

209440
runs-on: ${{ matrix.os }}
210441

@@ -253,7 +484,7 @@ jobs:
253484
$BC_TEST_SINGLETON = $BC_TEST_EXES.FullName;
254485
Write-Host "Executing $BC_TEST_SINGLETON $env:BOOST_UNIT_TEST_OPTIONS" -ForegroundColor Yellow;
255486
try {
256-
Invoke-Expression "$BC_TEST_SINGLETON $env:BOOST_UNIT_TEST_OPTIONS"
487+
Invoke-Expression "$BC_TEST_SINGLETON --run_test=${{ matrix.tests }} $env:BOOST_UNIT_TEST_OPTIONS"
257488
}
258489
catch {
259490
$ERR = $_;

build.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ IF %ERRORLEVEL% NEQ 0 (
6969
exit /b 1
7070
)
7171
call cd /d "%path_base%\%~1\builds\msvc\%proj_version%"
72-
call "%msbuild_exe%" %msbuild_args% %~1.sln
72+
call "%msbuild_exe%" %msbuild_args% %~1.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false
7373
IF %ERRORLEVEL% NEQ 0 (
7474
call :failure "%msbuild_exe% %msbuild_args% %~1.sln failed."
7575
exit /b 1
@@ -86,7 +86,7 @@ IF %ERRORLEVEL% NEQ 0 (
8686
exit /b 1
8787
)
8888
call cd /d "%path_base%\%~1\builds\msvc\%proj_version%"
89-
call "%msbuild_exe%" %msbuild_args% /target:%~1:Rebuild %~1.sln
89+
call "%msbuild_exe%" %msbuild_args% /target:%~1:Rebuild %~1.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false
9090
IF %ERRORLEVEL% NEQ 0 (
9191
call :failure "%msbuild_exe% %msbuild_args% /target:%~1:Rebuild %~1.sln"
9292
exit /b 1

0 commit comments

Comments
 (0)