File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 9
9
- nightly
10
10
11
11
before_install :
12
+ - script/ci/cargo-clean-on-new-rustc-version.sh
12
13
- rustup component add rustfmt
13
14
- rustup component add clippy
14
15
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ stamp_file=target/rustc_version_stamp
6
+ current_version=$( rustc --version)
7
+
8
+ if [ -f $stamp_file ]; then
9
+ # Compare the current version against the previous version
10
+ if echo " $current_version " | cmp -s $stamp_file -; then
11
+ echo " Version of rustc hasn't changed, keeping the cache intact"
12
+ else
13
+ echo " The version of rustc has changed, running cargo clean"
14
+ cargo clean
15
+ fi
16
+ else
17
+ echo " There is no existing version stamp, keeping the cache intact"
18
+ fi
19
+
20
+ # Save the version stamp for next time
21
+ mkdir -p target/
22
+ echo $current_version > $stamp_file
You can’t perform that action at this time.
0 commit comments