From 5a1a78e4b70a4b28f0a184de8fc7921994c76cce Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:46:29 +0100 Subject: [PATCH] fixup! ci: Test CMake edge cases Add a new "ubuntu-chainstate" job, which builds and runs the `bitcoin-chainstate` binary with static and shared `libbitcoinkernel`. --- .github/workflows/cmake.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 33508551063b12..454eb1c3c888f3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -262,6 +262,68 @@ jobs: ./install/bin/bitcoind -version + ubuntu-chainstate: + name: 'Ubuntu, chainstate + ${{ matrix.conf.job_name }} libkernel' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + conf: + - shared_libs: '-DBUILD_SHARED_LIBS=OFF' + job_name: 'STATIC' + - shared_libs: '-DBUILD_SHARED_LIBS=ON' + job_name: 'SHARED' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install packages + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends ccache libboost-dev libevent-dev + echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV" + + - name: CMake version + run: | + cmake --version + ctest --version + + - name: Restore Ccache cache + uses: actions/cache/restore@v4 + id: ccache-cache + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ github.job }}-ccache-${{ github.run_id }} + restore-keys: ${{ github.job }}-${{ matrix.conf.job_name }}-ccache- + + - name: Generate build system + run: | + cmake -B build -DBUILD_UTIL_CHAINSTATE=ON ${{ matrix.conf.shared_libs }} + + - name: Build + working-directory: build + run: | + cmake --build . -j $(nproc) --target bitcoin-chainstate + + - name: Ccache stats + run: | + ccache --version | head -n 1 + ccache --show-stats + + - name: Save Ccache cache + uses: actions/cache/save@v4 + if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ github.job }}-${{ matrix.conf.job_name }}-ccache-${{ github.run_id }} + + - name: Run bitcoin-chainstate + run: | + ./build/src/bitcoin-chainstate || true + + cross-build: name: ${{ matrix.host.name }} runs-on: ubuntu-latest