Make CI cache config explicit for all jobs; disable cache for all jobs that don't build Rust code.

This commit is contained in:
Heiko Schaefer 2022-04-25 20:30:17 +02:00
parent f7e4aa74d9
commit 195eb4b243
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2021-2022 Heiko Schaefer <heiko@schaefer.name> # SPDX-FileCopyrightText: 2021-2022 Heiko Schaefer <heiko@schaefer.name>
# SPDX-FileCopyrightText: 2021 Nora Widdecke <mail@nora.pink> # SPDX-FileCopyrightText: 2021-2022 Nora Widdecke <mail@nora.pink>
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
stages: stages:
@ -24,7 +24,6 @@ cache: &general_cache_config
pages: pages:
stage: pages stage: pages
cache: [ ]
image: debian:stable-slim image: debian:stable-slim
before_script: before_script:
- apt update -y -qq - apt update -y -qq
@ -36,16 +35,17 @@ pages:
artifacts: artifacts:
paths: paths:
- public - public
cache: [ ]
reuse: reuse:
stage: lint stage: lint
cache: [ ]
image: image:
name: fsfe/reuse:latest name: fsfe/reuse:latest
entrypoint: [ "" ] entrypoint: [ "" ]
script: script:
- reuse lint - reuse lint
dependencies: [] dependencies: [ ]
cache: [ ]
cargo-fmt: cargo-fmt:
stage: lint stage: lint
@ -53,6 +53,7 @@ cargo-fmt:
script: script:
- rustup component add rustfmt - rustup component add rustfmt
- cargo fmt -- --check - cargo fmt -- --check
cache: [ ]
cargo-deny: cargo-deny:
stage: lint stage: lint
@ -61,6 +62,7 @@ cargo-deny:
- cargo install --locked cargo-deny - cargo install --locked cargo-deny
script: script:
- cargo deny check - cargo deny check
cache: [ ]
cargo-clippy: cargo-clippy:
stage: lint stage: lint
@ -73,11 +75,15 @@ cargo-clippy:
script: script:
- rustup component add clippy - rustup component add clippy
- cargo clippy --verbose --tests -- -D warnings - cargo clippy --verbose --tests -- -D warnings
cache:
# inherit all general cache settings
<<: *general_cache_config
# override the key
key: "rust-latest"
udeps: udeps:
stage: lint stage: lint
image: rustlang/rust:nightly-slim image: rustlang/rust:nightly-slim
cache: [ ]
before_script: before_script:
- mkdir -p /run/user/$UID - mkdir -p /run/user/$UID
- apt update -y -qq - apt update -y -qq
@ -87,6 +93,7 @@ udeps:
- tar --extract --verbose --gzip --file /tmp/cargo-udeps.tar.gz --directory /usr/local/bin/ --strip-components=2 ./cargo-udeps-v0.1.26-x86_64-unknown-linux-gnu/cargo-udeps - tar --extract --verbose --gzip --file /tmp/cargo-udeps.tar.gz --directory /usr/local/bin/ --strip-components=2 ./cargo-udeps-v0.1.26-x86_64-unknown-linux-gnu/cargo-udeps
script: script:
- cargo udeps --workspace --all-features --all-targets - cargo udeps --workspace --all-features --all-targets
cache: [ ]
cargo-test: cargo-test:
stage: test stage: test
@ -134,6 +141,7 @@ run_cardtest_smartpgp:
# inherit all general cache settings # inherit all general cache settings
<<: *general_cache_config <<: *general_cache_config
# override the key # override the key
# (the base image of run_cardtest uses bookworm)
key: "bookworm" key: "bookworm"
run_cardtest_ykneo: run_cardtest_ykneo:
@ -150,6 +158,7 @@ run_cardtest_ykneo:
# inherit all general cache settings # inherit all general cache settings
<<: *general_cache_config <<: *general_cache_config
# override the key # override the key
# (the base image of run_cardtest uses bookworm)
key: "bookworm" key: "bookworm"
hardware-builddeps: hardware-builddeps:
@ -174,6 +183,7 @@ hardware-builddeps:
IMAGE_LATEST: $CI_REGISTRY_IMAGE/hardware-builddeps:latest IMAGE_LATEST: $CI_REGISTRY_IMAGE/hardware-builddeps:latest
IMAGE_SHA: $CI_REGISTRY_IMAGE/hardware-builddeps:$CI_COMMIT_SHA IMAGE_SHA: $CI_REGISTRY_IMAGE/hardware-builddeps:$CI_COMMIT_SHA
DOCKERFILE: card-functionality/docker/Dockerfile.hardware-builddeps DOCKERFILE: card-functionality/docker/Dockerfile.hardware-builddeps
cache: [ ]
.hw-test-template: .hw-test-template:
image: registry.gitlab.com/hkos/openpgp-card/hardware-builddeps image: registry.gitlab.com/hkos/openpgp-card/hardware-builddeps