Skip to content

Commit a079c4c

Browse files
committed
ci: cache Bitcoin Core source builds with ccache
Add ccache to the Bitcoin Core source build job using the same basic pattern as bitcoin-capnp-types: install ccache, restore ~/.cache/ccache, and use ccache as the CMake compiler launcher. Behavior changes: - Bitcoin Core source build jobs now restore and save a per-OS ccache cache. - Bitcoin Core C and C++ compilation goes through ccache. - The cache step uses actions/cache@v6.1.0, which runs on Node 24. - Integration-test artifact upload/download steps use current Node 24-compatible artifact actions.
1 parent 05151c5 commit a079c4c

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/integration-tests.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
cargo nextest archive --manifest-path=integration-tests/Cargo.toml --archive-file integration-test-binaries-${{ runner.os }}.tar.zst
6161
6262
- name: Upload compiled test archive
63-
uses: actions/upload-artifact@v4
63+
uses: actions/upload-artifact@v7
6464
with:
6565
name: integration-test-binaries-${{ runner.os }}
6666
path: integration-test-binaries-${{ runner.os }}.tar.zst
@@ -89,11 +89,18 @@ jobs:
8989
9090
- name: Install Bitcoin Core build dependencies (Ubuntu)
9191
if: matrix.os == 'ubuntu-latest'
92-
run: sudo apt-get install -y build-essential cmake pkgconf python3 libevent-dev libboost-dev libsqlite3-dev capnproto libcapnp-dev
92+
run: sudo apt-get install -y build-essential cmake pkgconf python3 libevent-dev libboost-dev libsqlite3-dev capnproto libcapnp-dev ccache
9393

9494
- name: Install Bitcoin Core build dependencies (macOS)
9595
if: matrix.os == 'macos-latest'
96-
run: brew install cmake boost pkgconf libevent sqlite capnp
96+
run: brew install cmake boost pkgconf libevent sqlite capnp ccache
97+
98+
- name: ccache
99+
uses: actions/cache@v6.1.0
100+
with:
101+
path: ~/.cache/ccache
102+
key: ccache-bitcoin-${{ runner.os }}-${{ github.sha }}
103+
restore-keys: ccache-bitcoin-${{ runner.os }}-
97104

98105
- name: Checkout Bitcoin Core source
99106
run: |
@@ -104,11 +111,12 @@ jobs:
104111
- name: Build Bitcoin Core
105112
run: |
106113
cd bitcoin
107-
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF
114+
export CCACHE_DIR="$HOME/.cache/ccache"
115+
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
108116
cmake --build build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu)"
109117
110118
- name: Upload Bitcoin Core binary
111-
uses: actions/upload-artifact@v4
119+
uses: actions/upload-artifact@v7
112120
with:
113121
name: bitcoin-core-${{ runner.os }}-${{ steps.bitcoin-core.outputs.cache-key }}
114122
path: bitcoin/build/bin/bitcoin-node
@@ -213,7 +221,7 @@ jobs:
213221

214222
- name: Download Bitcoin Core binary
215223
if: steps.bitcoin-core.outputs.source == 'true'
216-
uses: actions/download-artifact@v4
224+
uses: actions/download-artifact@v8
217225
with:
218226
name: bitcoin-core-${{ runner.os }}-${{ steps.bitcoin-core.outputs.cache-key }}
219227
path: bitcoin-core
@@ -236,7 +244,7 @@ jobs:
236244
run: cargo binstall --no-confirm --disable-telemetry --disable-strategies quick-install --locked cargo-nextest@0.9.100
237245

238246
- name: Download compiled test archive
239-
uses: actions/download-artifact@v4
247+
uses: actions/download-artifact@v8
240248
with:
241249
name: integration-test-binaries-${{ runner.os }}
242250

0 commit comments

Comments
 (0)