diff options
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..161f221 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +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 |