Skip to content

Commit

Permalink
fixup! ci: Test CMake edge cases
Browse files Browse the repository at this point in the history
Add a new "ubuntu-chainstate" job, which builds and runs the
`bitcoin-chainstate` binary with static and shared `libbitcoinkernel`.
  • Loading branch information
hebasto committed Jun 28, 2024
1 parent aadee95 commit f39a181
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,69 @@ 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: |
ccache --zero-stats
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 || [[ $? -eq 1 ]]
cross-build:
name: ${{ matrix.host.name }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit f39a181

Please sign in to comment.