diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-11-21 16:53:28 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-11-21 17:33:07 +0100 |
| commit | ba9cc102e295634035a3f9bac1b4656e735c5fc6 (patch) | |
| tree | d080028538cf75a9a18a562ef1e947179c828b22 /.github/ci/build.sh | |
| parent | 32b59148a8c40f3c8d74510d26c7c36791f53580 (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.
Diffstat (limited to '.github/ci/build.sh')
| -rwxr-xr-x | .github/ci/build.sh | 10 |
1 files changed, 10 insertions, 0 deletions
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. |
| 19 | export CARGO_NET_GIT_FETCH_WITH_CLI=true | 19 | export CARGO_NET_GIT_FETCH_WITH_CLI=true |
| 20 | 20 | ||
| 21 | # Restore lockfiles | ||
| 22 | if [ -f /ci/cache/lockfiles.tar ]; then | ||
| 23 | echo Restoring lockfiles... | ||
| 24 | tar xf /ci/cache/lockfiles.tar | ||
| 25 | fi | ||
| 26 | |||
| 21 | hashtime restore /ci/cache/filetime.json || true | 27 | hashtime restore /ci/cache/filetime.json || true |
| 22 | hashtime save /ci/cache/filetime.json | 28 | hashtime save /ci/cache/filetime.json |
| 23 | 29 | ||
| 24 | ./ci.sh | 30 | ./ci.sh |
| 31 | |||
| 32 | # Save lockfiles | ||
| 33 | echo Saving lockfiles... | ||
| 34 | find . -type f -name Cargo.lock -exec tar -cf /ci/cache/lockfiles.tar '{}' \+ \ No newline at end of file | ||
