Skip to content

Commit 165a9f7

Browse files
committed
Enable caching for bitcoind/electrs in CI
1 parent 952b889 commit 165a9f7

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/rust.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,26 @@ jobs:
5353
- name: Set RUSTFLAGS to deny warnings
5454
if: "matrix.toolchain == 'stable'"
5555
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
56+
- name: Enable caching for bitcoind
57+
id: cache-bitcoind
58+
uses: actions/cache@v4
59+
with:
60+
path: $HOME/bin/bitcoind
61+
key: bitcoind
62+
- name: Enable caching for electrs
63+
id: cache-electrs
64+
uses: actions/cache@v4
65+
with:
66+
path: $HOME/bin/electrs
67+
key: electrs
5668
- name: Download bitcoind/electrs and set environment variables
57-
if: "matrix.platform != 'windows-latest'"
69+
if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
5870
run: |
5971
source ./scripts/download_bitcoind_electrs.sh
60-
cp "$BITCOIND_EXE" "$HOME"/bitcoind
61-
cp "$ELECTRS_EXE" "$HOME"/electrs
62-
echo "BITCOIND_EXE=$HOME/bitcoind" >> "$GITHUB_ENV"
63-
echo "ELECTRS_EXE=$HOME/electrs" >> "$GITHUB_ENV"
72+
cp "$BITCOIND_EXE" "$HOME"/bin/bitcoind
73+
cp "$ELECTRS_EXE" "$HOME"/bin/electrs
74+
echo "BITCOIND_EXE=$HOME/bin/bitcoind" >> "$GITHUB_ENV"
75+
echo "ELECTRS_EXE=$HOME/bin/electrs" >> "$GITHUB_ENV"
6476
- name: Build on Rust ${{ matrix.toolchain }}
6577
run: cargo build --verbose --color always
6678
- name: Build with UniFFI support on Rust ${{ matrix.toolchain }}

0 commit comments

Comments
 (0)