variables: # GitLab CI can only cache data that resides in /builds/ and /cache/ # directories[1]. Both of these locations are *not* writeable to non-privileged # users, but the project directory (the Git workdir) is — it's # world-writeable. So we ask Cargo to put its caches inside the Git workdir. # # 1. https://gitlab.com/gitlab-org/gitlab-runner/-/issues/327 CARGO_HOME: $CI_PROJECT_DIR/.cargo check: parallel: matrix: - IMAGE: bullseye-main image: registry.gitlab.com/obnam/container-images:$IMAGE script: # If any of the checks fail, print out the Subplot log and propagate the # error. - ./check -v || (cat test.log; exit 1) # Remove all build artifacts unrelated to the currently installed Rust # toolchain(s). We have to tweak the PATH because of the caching-related # shenanigans described in the "variables" section above. - PATH=${CARGO_INSTALL_ROOT}/bin:${PATH} cargo sweep --installed cache: key: check-job-cache-for-docker paths: - $CARGO_HOME/registry/cache - $CARGO_HOME/registry/index - target