Skip to content

Commit 4eee53d

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 c1ece4e commit 4eee53d

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
@@ -52,7 +52,7 @@ jobs:
5252
cargo nextest archive --manifest-path=integration-tests/Cargo.toml --archive-file integration-test-binaries-${{ runner.os }}.tar.zst
5353
5454
- name: Upload compiled test archive
55-
uses: actions/upload-artifact@v4
55+
uses: actions/upload-artifact@v7
5656
with:
5757
name: integration-test-binaries-${{ runner.os }}
5858
path: integration-test-binaries-${{ runner.os }}.tar.zst
@@ -83,11 +83,18 @@ jobs:
8383
8484
- name: Install Bitcoin Core build dependencies (Ubuntu)
8585
if: matrix.os == 'ubuntu-latest'
86-
run: sudo apt-get install -y build-essential cmake pkgconf python3 libevent-dev libboost-dev libsqlite3-dev capnproto libcapnp-dev
86+
run: sudo apt-get install -y build-essential cmake pkgconf python3 libevent-dev libboost-dev libsqlite3-dev capnproto libcapnp-dev ccache
8787

8888
- name: Install Bitcoin Core build dependencies (macOS)
8989
if: matrix.os == 'macos-latest'
90-
run: brew install cmake boost pkgconf libevent sqlite capnp
90+
run: brew install cmake boost pkgconf libevent sqlite capnp ccache
91+
92+
- name: ccache
93+
uses: actions/cache@v6.1.0
94+
with:
95+
path: ~/.cache/ccache
96+
key: ccache-bitcoin-${{ runner.os }}-${{ github.sha }}
97+
restore-keys: ccache-bitcoin-${{ runner.os }}-
9198

9299
- name: Checkout Bitcoin Core source
93100
run: |
@@ -98,11 +105,12 @@ jobs:
98105
- name: Build Bitcoin Core
99106
run: |
100107
cd bitcoin
101-
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF
108+
export CCACHE_DIR="$HOME/.cache/ccache"
109+
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
102110
cmake --build build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu)"
103111
104112
- name: Upload Bitcoin Core binary
105-
uses: actions/upload-artifact@v4
113+
uses: actions/upload-artifact@v7
106114
with:
107115
name: bitcoin-core-${{ runner.os }}-${{ steps.bitcoin-core.outputs.cache-key }}
108116
path: bitcoin/build/bin/bitcoin-node
@@ -204,7 +212,7 @@ jobs:
204212

205213
- name: Download Bitcoin Core binary
206214
if: steps.bitcoin-core.outputs.source == 'true'
207-
uses: actions/download-artifact@v4
215+
uses: actions/download-artifact@v8
208216
with:
209217
name: bitcoin-core-${{ runner.os }}-${{ steps.bitcoin-core.outputs.cache-key }}
210218
path: bitcoin-core
@@ -219,7 +227,7 @@ jobs:
219227
github-token: ${{ github.token }}
220228

221229
- name: Download compiled test archive
222-
uses: actions/download-artifact@v4
230+
uses: actions/download-artifact@v8
223231
with:
224232
name: integration-test-binaries-${{ runner.os }}
225233

0 commit comments

Comments
 (0)