Skip to content

Commit 16e9fff

Browse files
authored
Merge pull request #106 from Zondax/fix/cache-clobber-clippy-rust-tests
fix(ledger): re-checkout cargo config in clippy/rust_tests jobs too
2 parents c90c53d + 2bf2d28 commit 16e9fff

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/_ledger_main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ jobs:
158158
restore-keys: |
159159
${{ runner.os }}-cargo-${{ runner.arch }}-
160160
${{ runner.os }}-cargo-
161+
- name: Restore tracked cargo config (cache may carry a pre-migration copy)
162+
run: |
163+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
164+
if git -C "$GITHUB_WORKSPACE" ls-files --error-unmatch app/rust/.cargo/config.toml >/dev/null 2>&1; then
165+
git -C "$GITHUB_WORKSPACE" checkout -- app/rust/.cargo/config.toml
166+
echo "Restored app/rust/.cargo/config.toml from checkout (a stale Rust cache can overwrite it with a pre-migration copy)."
167+
fi
161168
- name: clippy
162169
run: |
163170
cd ./app/rust
@@ -182,6 +189,13 @@ jobs:
182189
restore-keys: |
183190
${{ runner.os }}-cargo-${{ runner.arch }}-
184191
${{ runner.os }}-cargo-
192+
- name: Restore tracked cargo config (cache may carry a pre-migration copy)
193+
run: |
194+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
195+
if git -C "$GITHUB_WORKSPACE" ls-files --error-unmatch app/rust/.cargo/config.toml >/dev/null 2>&1; then
196+
git -C "$GITHUB_WORKSPACE" checkout -- app/rust/.cargo/config.toml
197+
echo "Restored app/rust/.cargo/config.toml from checkout (a stale Rust cache can overwrite it with a pre-migration copy)."
198+
fi
185199
- name: run rust tests
186200
run: |
187201
cd ./app/rust

0 commit comments

Comments
 (0)