From e82d30b956fe1fd3b7940d008d7a367643bbf05f Mon Sep 17 00:00:00 2001 From: Nora Widdecke Date: Tue, 25 Oct 2022 11:53:06 +0200 Subject: [PATCH] ci: Extract subplot into its own job - Subplot requires the presence of virtual cards, so it needs an image where they are present. However this interferes with the intentions of the cargo-test and cargo-test-debian-bookworm jobs. - Revert the cargo-test and cargo-test-debian-bookworm jobs to the environments they used to test, rust:latest and debain:bookworm-slim, respectively. - Add a test "subplot" that runs the subplot tests as part of the virtual-test stage. --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93a4855..0b52c8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,16 +83,15 @@ udeps: cargo-test: stage: test - image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps + image: rust:latest before_script: - mkdir -p /run/user/$UID - apt update -y -qq - apt install -y -qq --no-install-recommends git clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev - apt clean - - /etc/init.d/pcscd start - - su - -c "sh /home/jcardsim/run-card.sh >/dev/null" jcardsim script: - - touch tools/virtual-card-available + # there is no virtual card in this image, so subplot does not generate tests + # that would require one. - cargo test cache: # inherit all general cache settings @@ -102,16 +101,15 @@ cargo-test: cargo-test-debian-bookworm: stage: test - image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps + image: debian:bookworm-slim before_script: - mkdir -p /run/user/$UID - apt update -y -qq - apt install -y -qq --no-install-recommends git rustc cargo clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev - apt clean - - /etc/init.d/pcscd start - - su - -c "sh /home/jcardsim/run-card.sh >/dev/null" jcardsim script: - - touch tools/virtual-card-available + # there is no virtual card in this image, so subplot does not generate tests + # that would require one. - cargo test cache: # inherit all general cache settings @@ -119,6 +117,27 @@ cargo-test-debian-bookworm: # override the key key: "bookworm" +subplot: + stage: virtual-test + image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps + before_script: + - mkdir -p /run/user/$UID + - apt update -y -qq + - apt install -y -qq --no-install-recommends git clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev + - apt clean + - /etc/init.d/pcscd start + - su - -c "sh /home/jcardsim/run-card.sh >/dev/null" jcardsim + script: + # make sure a virtual card is available, so that the subplot tests are + # generated + - touch tools/virtual-card-available + - cargo test + cache: + # inherit all general cache settings + <<: *general_cache_config + # override the key + key: "rust-latest" + run_cardtest_smartpgp: stage: virtual-test image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps