Skip to content

Commit b5065dd

Browse files
mikemaccanaclaude
andcommitted
Add caching to GitHub Actions workflow
Cache Cargo registry/binaries and Solana CLI to significantly reduce CI build times. The Cargo cache is keyed by Cargo.lock hash, and the Solana cache is keyed by version (2.3.11). This should reduce the ~6 minute Anchor installation time and avoid re-downloading Solana CLI on every run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7643e72 commit b5065dd

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,32 @@ on:
99
jobs:
1010
run-arcium-build:
1111
runs-on: ubuntu-latest
12-
# TODO: Add caching for Rust, Solana CLI, Anchor, and Arcium installations
13-
# to reduce CI build times. Consider using actions/cache for:
14-
# - ~/.cargo (Rust toolchain and Anchor)
15-
# - ~/.local/share/solana (Solana CLI)
1612
steps:
1713
- uses: actions/checkout@v3
1814

1915
- name: Install libudev
2016
run: sudo apt-get update && sudo apt-get install -y libudev-dev
2117

18+
- name: Cache Cargo registry and installed binaries
19+
uses: actions/cache@v3
20+
with:
21+
path: |
22+
~/.cargo/bin/
23+
~/.cargo/registry/index/
24+
~/.cargo/registry/cache/
25+
~/.cargo/git/db/
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-cargo-
29+
30+
- name: Cache Solana CLI
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/.local/share/solana/install
34+
key: ${{ runner.os }}-solana-2.3.11
35+
restore-keys: |
36+
${{ runner.os }}-solana-
37+
2238
- name: Install Rust
2339
run: |
2440
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

0 commit comments

Comments
 (0)