Skip to content

Commit 3926447

Browse files
Update GitHub Actions workflow for Rust release and add caching
- Specify Rust toolchain version to 1.88.0 in release.yml - Add caching for cargo registry, cargo index, and target directory to improve build performance - Update .gitignore to remove Cargo.lock from being ignored - Add new Cargo.lock file to track dependencies
1 parent ebb5856 commit 3926447

File tree

4 files changed

+1118
-4
lines changed

4 files changed

+1118
-4
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,28 @@ jobs:
2929
uses: actions/checkout@v4
3030

3131
- name: Install Rust
32-
uses: dtolnay/rust-toolchain@stable
32+
uses: dtolnay/rust-toolchain@1.88.0
3333
with:
3434
targets: ${{ matrix.target }}
3535

36+
- name: Cache cargo registry
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cargo/registry
40+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
41+
42+
- name: Cache cargo index
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/.cargo/git
46+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
47+
48+
- name: Cache target directory
49+
uses: actions/cache@v4
50+
with:
51+
path: target
52+
key: ${{ runner.os }}-target-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
53+
3654
- name: Build binary
3755
run: cargo build --release --target ${{ matrix.target }}
3856

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.vscode
2-
target
3-
Cargo.lock
2+
target

0 commit comments

Comments
 (0)