Preserve caches during git-clean
This MR introduces a fix to the bdt clean
command, preserving pre-commit and torch caches so the gitlab-runner can actually store them. Otherwise, .cache
directories are removed and not cached between builds. You can see that already happening in some examples, despite running pre-commit (at least):
- https://gitlab.idiap.ch/bob/bob.extension/-/jobs/274957
- https://gitlab.idiap.ch/bob/bob.bio.face/-/jobs/279560
That said, IDK if using the after_script
section of bootstrap
wouldn't be cleverer to carry on the bdt clean
operation. It is run no matter what. The second point is that we should probably list what to keep on the CI file itself. Currently, things to cache are defined on the CI file, whereas what to clean defined in a Python file. At least by moving what to clean into the CI file everything would be defined in a single easy to maintain place.