forked from rust-lang/crates.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1580: Prune some build artifacts on CI to speed up caching r=jtgeibel a=jtgeibel This script deletes final build artifacts, which are often large and cannot be reused if any backend code has changed. Dependencies and incremental artifacts are left in place. Co-authored-by: Justin Geibel <jtgeibel@gmail.com>
- Loading branch information
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Initial cache size:" | ||
du -hs target/debug | ||
|
||
crate_name="cargo-registry" | ||
test_name="all" | ||
bin_names="delete-crate delete-version populate render-readmes server test-pagerduty transfer-crates update-downloads" | ||
|
||
normalized_crate_name=${crate_name//-/_} | ||
rm -v target/debug/$normalized_crate_name-* | ||
rm -v target/debug/deps/$normalized_crate_name-* | ||
rm -v target/debug/deps/lib$normalized_crate_name-* | ||
|
||
normalized_test_name=${test_name//-/_} | ||
rm -v target/debug/$normalized_test_name-* | ||
rm -v target/debug/deps/$normalized_test_name-* | ||
|
||
for name in $bin_names; do | ||
rm -v target/debug/$name | ||
normalized=${name//-/_} | ||
rm -v target/debug/$normalized-* | ||
rm -v target/debug/deps/$normalized-* | ||
done | ||
|
||
echo "Final cache size:" | ||
du -hs target/debug |