Skip to content

Merge pull request #765 from evoskuil/master #1284

Merge pull request #765 from evoskuil/master

Merge pull request #765 from evoskuil/master #1284

Workflow file for this run

###############################################################################
# Copyright (c) 2014-2026 libbitcoin-database developers (see COPYING).
#
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
#
###############################################################################
name: Continuous Integration
on: [ pull_request, push, workflow_dispatch ]
jobs:
gnu:
strategy:
fail-fast: false
matrix:
include:
- image: macos-latest
config: "release"
link: "dynamic"
cc: "clang"
cxx: "clang++"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
- image: macos-latest
config: "release"
link: "static"
cc: "clang"
cxx: "clang++"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
- image: ubuntu-24.04
config: "debug"
link: "dynamic"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
- image: ubuntu-24.04
config: "release"
link: "static"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
- image: ubuntu-24.04
config: "release"
link: "dynamic"
cc: "gcc-12"
cxx: "g++-12"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
- image: ubuntu-24.04
config: "debug"
link: "static"
cc: "gcc"
cxx: "g++"
flags: "--coverage -fprofile-update=atomic"
coverage: "lcov"
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--enable-isystem"
runs-on: ${{ matrix.image }}
env:
CC: '${{ matrix.cc }}'
CXX: '${{ matrix.cxx }}'
CFLAGS: '${{ matrix.flags }}'
CXXFLAGS: '${{ matrix.flags }}'
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Sources directory path assignment
shell: bash
run: |
cd ..
echo SRC_PATH="$(pwd)" >> $GITHUB_ENV
- name: Prepare toolchain [linux]
if: ${{ startsWith(matrix.image, 'ubuntu') }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.package || '' }}
if [[ "${{ matrix.coverage }}" == "lcov" ]]; then
sudo apt-get install lcov
fi
- name: Prepare toolchain [macos]
if: ${{ startsWith(matrix.image, 'macos') }}
shell: bash
run: |
brew install autoconf automake libtool ${{ matrix.package || '' }}
if [[ -n "${{ matrix.llvm }}" ]]; then
echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:${PATH}" >> $GITHUB_ENV
fi
- name: Environmental Computation
shell: bash
run: |
if [[ "${{ matrix.link }}" == "dynamic" ]]; then
echo "LDFLAGS=-Wl,-rpath,${{ env.SRC_PATH }}/prefix/lib" >> $GITHUB_ENV
fi
- name: Execute installation
shell: bash
run: >
./builds/gnu/install-gnu.sh
--build-use-local-src
--build-src-dir="${{ env.SRC_PATH }}"
--prefix="${{ env.SRC_PATH }}/prefix"
--build-obj-dir="obj"
--build-obj-dir-relative
--build-config="${{ matrix.config }}"
--build-link="${{ matrix.link }}"
${{ matrix.boost }}
${{ matrix.secp256k1 }}
${{ matrix.options }}
- name: Coverage calculation
if: ${{ matrix.coverage == 'lcov' }}
shell: bash
run: |
lcov --ignore-errors version,gcov,mismatch,mismatch --directory . --capture --output-file coverage.info
lcov --ignore-errors unused --remove coverage.info "${{ env.SRC_PATH }}/prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
- name: Coveralls.io upload
if: ${{ matrix.coverage == 'lcov' }}
uses: coverallsapp/github-action@v2.3.6
with:
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}
cmake:
strategy:
fail-fast: false
matrix:
include:
- image: macos-latest
config: "release"
link: "dynamic"
cc: "clang"
cxx: "clang++"
flags: "-DNDEBUG"
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--verbose"
- image: macos-latest
config: "release"
link: "static"
cc: "clang"
cxx: "clang++"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: "--verbose"
- image: ubuntu-24.04
config: "debug"
link: "dynamic"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
- image: ubuntu-24.04
config: "release"
link: "static"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
- image: ubuntu-24.04
config: "release"
link: "dynamic"
cc: "gcc-12"
cxx: "g++-12"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
- image: ubuntu-24.04
config: "debug"
link: "static"
cc: "gcc"
cxx: "g++"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
runs-on: ${{ matrix.image }}
env:
CC: '${{ matrix.cc }}'
CXX: '${{ matrix.cxx }}'
CFLAGS: '${{ matrix.flags }}'
CXXFLAGS: '${{ matrix.flags }}'
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Sources directory path assignment
shell: bash
run: |
cd ..
echo SRC_PATH="$(pwd)" >> $GITHUB_ENV
- name: Prepare toolchain [linux]
if: ${{ startsWith(matrix.image, 'ubuntu') }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.package || '' }}
if [[ "${{ matrix.coverage }}" == "lcov" ]]; then
sudo apt-get install lcov
fi
- name: Prepare toolchain [macos]
if: ${{ startsWith(matrix.image, 'macos') }}
shell: bash
run: |
brew install autoconf automake libtool ${{ matrix.package || '' }}
if [[ -n "${{ matrix.llvm }}" ]]; then
echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:${PATH}" >> $GITHUB_ENV
fi
- name: Environmental Computation
shell: bash
run: |
if [[ "${{ matrix.link }}" == "dynamic" ]]; then
echo "LDFLAGS=-Wl,-rpath,${{ env.SRC_PATH }}/prefix/lib" >> $GITHUB_ENV
fi
- name: Execute installation
shell: bash
run: >
./builds/cmake/install-cmake.sh
--build-use-local-src
--build-src-dir="${{ env.SRC_PATH }}"
--prefix="${{ env.SRC_PATH }}/prefix"
--build-obj-dir="obj"
--build-obj-dir-relative
--build-config="${{ matrix.config }}"
--build-link="${{ matrix.link }}"
${{ matrix.boost }}
${{ matrix.secp256k1 }}
${{ matrix.options }}
- name: Coverage calculation
if: ${{ matrix.coverage == 'lcov' }}
shell: bash
run: |
lcov --ignore-errors version,gcov,mismatch,mismatch --directory . --capture --output-file coverage.info
lcov --ignore-errors unused --remove coverage.info "${{ env.SRC_PATH }}/prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
- name: Coveralls.io upload
if: ${{ matrix.coverage == 'lcov' }}
uses: coverallsapp/github-action@v2.3.6
with:
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}
presets:
strategy:
fail-fast: false
matrix:
include:
- image: ubuntu-24.04
preset: "nix-gnu-debug-shared"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
- image: ubuntu-24.04
preset: "nix-gnu-release-static"
cc: "clang-18"
cxx: "clang++-18"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
- image: ubuntu-24.04
preset: "nix-gnu-release-shared"
cc: "gcc-12"
cxx: "g++-12"
flags: ""
coverage: ""
boost: "--build-boost"
secp256k1: "--build-secp256k1"
options: ""
runs-on: ${{ matrix.image }}
env:
CC: '${{ matrix.cc }}'
CXX: '${{ matrix.cxx }}'
CFLAGS: '${{ matrix.flags }}'
CXXFLAGS: '${{ matrix.flags }}'
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Sources directory path assignment
shell: bash
run: |
cd ..
echo SRC_PATH="$(pwd)" >> $GITHUB_ENV
- name: Prepare toolchain [linux]
if: ${{ startsWith(matrix.image, 'ubuntu') }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.package || '' }}
if [[ "${{ matrix.coverage }}" == "lcov" ]]; then
sudo apt-get install lcov
fi
- name: Prepare toolchain [macos]
if: ${{ startsWith(matrix.image, 'macos') }}
shell: bash
run: |
brew install autoconf automake libtool ${{ matrix.package || '' }}
if [[ -n "${{ matrix.llvm }}" ]]; then
echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:${PATH}" >> $GITHUB_ENV
fi
- name: Environmental Computation
shell: bash
run: |
if [[ "${{ matrix.preset }}" == *shared* ]]; then
echo "LDFLAGS=-Wl,-rpath,${{ env.SRC_PATH }}/prefix/lib" >> $GITHUB_ENV
fi
- name: Execute installation
shell: bash
run: >
./builds/cmake/install-presets.sh
--build-use-local-src
--build-src-dir="${{ env.SRC_PATH }}"
--build-preset="${{ matrix.preset }}"
${{ matrix.boost }}
${{ matrix.secp256k1 }}
${{ matrix.options }}
- name: Coverage calculation
if: ${{ matrix.coverage == 'lcov' }}
shell: bash
run: |
lcov --ignore-errors version,gcov,mismatch,mismatch --directory . --capture --output-file coverage.info
lcov --ignore-errors unused --remove coverage.info "${{ env.SRC_PATH }}/prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
- name: Coveralls.io upload
if: ${{ matrix.coverage == 'lcov' }}
uses: coverallsapp/github-action@v2.3.6
with:
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}
msvc:
strategy:
fail-fast: false
matrix:
include:
- image: windows-latest
configuration: "StaticRelease"
platform: "x64"
version: "vs2022"
tests: "*"
- image: windows-latest
configuration: "StaticDebug"
platform: "x64"
version: "vs2022"
tests: "*"
runs-on: ${{ matrix.image }}
steps:
- name: Set msbuild path
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: Checkout repository
uses: actions/checkout@v6
- name: Execute build
shell: cmd
run: >
.\builds\msvc\build-msvc.cmd
--build-src-dir "%RUNNER_WORKSPACE%"
--build-config ${{ matrix.configuration }}
--build-platform ${{ matrix.platform }}
--build-version ${{ matrix.version }}
--build-use-local-src
- name: Execute tests
shell: powershell
run: |
Write-Host "Locating test executables..." -ForegroundColor Yellow;
$BC_TEST_EXES = @(Get-ChildItem -Path "$env:${{ github.workspace }}\bin" -recurse | Where-Object { $_.Name -eq "libbitcoin-database-test.exe" });
If ($BC_TEST_EXES.Count -ne 1) {
Write-Host "Failure, invalid count of test executables." -ForegroundColor Red;
exit 1;
}
Write-Host "Found single test executable: " $BC_TEST_EXES.FullName -ForegroundColor Green;
$BC_TEST_SINGLETON = $BC_TEST_EXES.FullName;
Write-Host "Executing $BC_TEST_SINGLETON $env:BOOST_UNIT_TEST_OPTIONS" -ForegroundColor Yellow;
try {
Invoke-Expression "$BC_TEST_SINGLETON --log_level=warning --run_test=${{ matrix.tests }} $env:BOOST_UNIT_TEST_OPTIONS"
}
catch {
$ERR = $_;
Write-Host "Test execution failure: " $ERR -ForegroundColor Red;
exit $ERR;
}
Write-Host "Test execution complete." -ForegroundColor Green;