aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-11-21 16:53:28 +0100
committerDario Nieuwenhuis <[email protected]>2023-11-21 17:33:07 +0100
commitba9cc102e295634035a3f9bac1b4656e735c5fc6 (patch)
treed080028538cf75a9a18a562ef1e947179c828b22
parent32b59148a8c40f3c8d74510d26c7c36791f53580 (diff)
ci: cache lockfiles
- Removes the slow "updating crates.io index, updating git" at start of the job. - Avoids CI being randomly slower if a widely-used dep (like serde) gets bumped causing rebuilding everything.
-rwxr-xr-x.github/ci/build-stable.sh10
-rwxr-xr-x.github/ci/build.sh10
2 files changed, 20 insertions, 0 deletions
diff --git a/.github/ci/build-stable.sh b/.github/ci/build-stable.sh
index 8012f6923..ffaebeb35 100755
--- a/.github/ci/build-stable.sh
+++ b/.github/ci/build-stable.sh
@@ -12,9 +12,19 @@ export CARGO_TARGET_DIR=/ci/cache/target
12# used when pointing stm32-metapac to a CI-built one. 12# used when pointing stm32-metapac to a CI-built one.
13export CARGO_NET_GIT_FETCH_WITH_CLI=true 13export CARGO_NET_GIT_FETCH_WITH_CLI=true
14 14
15# Restore lockfiles
16if [ -f /ci/cache/lockfiles.tar ]; then
17 echo Restoring lockfiles...
18 tar xf /ci/cache/lockfiles.tar
19fi
20
15hashtime restore /ci/cache/filetime.json || true 21hashtime restore /ci/cache/filetime.json || true
16hashtime save /ci/cache/filetime.json 22hashtime save /ci/cache/filetime.json
17 23
18sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml 24sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml
19 25
20./ci_stable.sh 26./ci_stable.sh
27
28# Save lockfiles
29echo Saving lockfiles...
30find . -type f -name Cargo.lock -exec tar -cf /ci/cache/lockfiles.tar '{}' \+ \ No newline at end of file
diff --git a/.github/ci/build.sh b/.github/ci/build.sh
index 78ab976df..e7a6c0d86 100755
--- a/.github/ci/build.sh
+++ b/.github/ci/build.sh
@@ -18,7 +18,17 @@ fi
18# used when pointing stm32-metapac to a CI-built one. 18# used when pointing stm32-metapac to a CI-built one.
19export CARGO_NET_GIT_FETCH_WITH_CLI=true 19export CARGO_NET_GIT_FETCH_WITH_CLI=true
20 20
21# Restore lockfiles
22if [ -f /ci/cache/lockfiles.tar ]; then
23 echo Restoring lockfiles...
24 tar xf /ci/cache/lockfiles.tar
25fi
26
21hashtime restore /ci/cache/filetime.json || true 27hashtime restore /ci/cache/filetime.json || true
22hashtime save /ci/cache/filetime.json 28hashtime save /ci/cache/filetime.json
23 29
24./ci.sh 30./ci.sh
31
32# Save lockfiles
33echo Saving lockfiles...
34find . -type f -name Cargo.lock -exec tar -cf /ci/cache/lockfiles.tar '{}' \+ \ No newline at end of file