summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 161f221f1748963ad0c8d4a5990c860657506fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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