Skip to content

Commit c45fd68

Browse files
committed
workspace: check in Cargo.lock
This is fine as the Cargo.lock lives on the top level and is not automatically packaged into the crates, when they are published. This guarantees us increased CI stability and better caching.
1 parent 678bcc1 commit c45fd68

File tree

3 files changed

+98
-4
lines changed

3 files changed

+98
-4
lines changed

.github/workflows/_build-rust.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ jobs:
5858
~/.cargo/registry/cache/
5959
~/.cargo/git/db/
6060
target/
61-
# We do not have a Cargo.lock here, so I hash Cargo.toml
62-
key: ${{ runner.os }}-rust-${{ inputs.rust-version }}-cargo-${{ hashFiles('**/Cargo.toml') }}
63-
restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
61+
# Hash over Cargo.toml and Cargo.lock, as this might be copied to
62+
# projects that do not have a Cargo.lock in their repository tree!
63+
key: ${{ runner.os }}-rust-${{ inputs.rust-version }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
6464
- run: cargo version
6565
- name: Build (library)
6666
run: cargo build --target ${{ inputs.rust-target }} --features ${{ inputs.features }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
target
2-
Cargo.lock
32
*.swp

Cargo.lock

+95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)