Configure caching of Rust build artifacts.

Don't 'cd' into the card-functionality directory to run tests ('cd'-ing broke the caching mechanism).
Adjust test configurations accordingly.
This commit is contained in:
puzzlewolf 2021-12-17 18:05:51 +01:00 committed by Heiko Schaefer
parent 4988ccea49
commit f312ce94f7
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
7 changed files with 75 additions and 37 deletions

View file

@ -3,12 +3,23 @@
# SPDX-License-Identifier: CC0-1.0
stages:
- hw-builddeps
- hw-import
- hw-keygen
- lint
- test
- virtual-test
- hw-builddeps
- hw-import
- hw-keygen
variables:
CARGO_HOME: cargo/
CARGO_TERM_VERBOSE: 'true'
cache: &general_cache_config
# default key is default
# default policy is pull-push
paths:
- target/
- $CARGO_HOME
reuse:
stage: lint
@ -35,6 +46,11 @@ cargo-test:
- apt clean
script:
- cargo test
cache:
# inherit all general cache settings
<<: *general_cache_config
# override the key
key: "rust-latest"
cargo-test-debian-bookworm:
stage: test
@ -46,6 +62,11 @@ cargo-test-debian-bookworm:
- apt clean
script:
- cargo test
cache:
# inherit all general cache settings
<<: *general_cache_config
# override the key
key: "bookworm"
run_cardtest_smartpgp:
stage: virtual-test
@ -53,11 +74,15 @@ run_cardtest_smartpgp:
script:
- /etc/init.d/pcscd start
- su - -c "sh /home/jcardsim/run-card.sh" jcardsim
- cd card-functionality
- cargo run --bin import -- $CONFIG
- cargo run --bin keygen -- $CONFIG
- cargo run -p openpgp-card-tests --bin import -- $CONFIG
- cargo run -p openpgp-card-tests --bin keygen -- $CONFIG
variables:
CONFIG: "docker/test-smartpgp.toml"
CONFIG: "card-functionality/docker/test-smartpgp.toml"
cache:
# inherit all general cache settings
<<: *general_cache_config
# override the key
key: "bookworm"
run_cardtest_ykneo:
stage: virtual-test
@ -65,11 +90,15 @@ run_cardtest_ykneo:
script:
- /etc/init.d/pcscd start
- su - -c "sh /home/jcardsim/run-card.sh" jcardsim
- cd card-functionality
- cargo run --bin import -- $CONFIG
- cargo run --bin keygen -- $CONFIG
- cargo run -p openpgp-card-tests --bin import -- $CONFIG
- cargo run -p openpgp-card-tests --bin keygen -- $CONFIG
variables:
CONFIG: "docker/test-ykneo.toml"
CONFIG: "card-functionality/docker/test-ykneo.toml"
cache:
# inherit all general cache settings
<<: *general_cache_config
# override the key
key: "bookworm"
hardware-builddeps:
stage: hw-builddeps
@ -101,15 +130,20 @@ hardware-builddeps:
parallel:
matrix:
- CONFIG:
- "ci/basic-2_1.toml"
- "ci/nitro-pro1.toml"
- "ci/nitro-pro2.toml"
- "ci/nitro-start.toml"
- "card-functionality/ci/basic-2_1.toml"
- "card-functionality/ci/nitro-pro1.toml"
- "card-functionality/ci/nitro-pro2.toml"
- "card-functionality/ci/nitro-start.toml"
script:
- /etc/init.d/pcscd start
#- sleep 5
- cd card-functionality
- cargo run --bin $ARG -- $CONFIG
cache:
# inherit all general cache settings
<<: *general_cache_config
# cookiejar does not access the cache of the shared gitlab runners,
# so use a different key for clarity
key: "cookiejar"
import:
extends: .hw-test-template

View file

@ -4,4 +4,8 @@
[card.basic-2_1]
backend.pcsc = "0005:00002E32"
config.keygen = ["RSA2k", "RSA3k", "RSA4k"]
config.import = ["data/rsa2k.sec", "data/rsa3k.sec", "data/rsa4k.sec"]
config.import = [
"card-functionality/data/rsa2k.sec",
"card-functionality/data/rsa3k.sec",
"card-functionality/data/rsa4k.sec"
]

View file

@ -7,7 +7,7 @@ config.keygen = [
"RSA2k", "RSA3k", "RSA4k",
]
config.import = [
"data/rsa2k.sec",
"data/rsa3k.sec",
"data/rsa4k.sec",
"card-functionality/data/rsa2k.sec",
"card-functionality/data/rsa3k.sec",
"card-functionality/data/rsa4k.sec",
]

View file

@ -8,10 +8,10 @@ config.keygen = [
"NIST256", "NIST384", "NIST521",
]
config.import = [
"data/rsa2k.sec",
"data/rsa3k.sec",
"data/rsa4k.sec",
"data/nist256.sec",
"data/nist384.sec",
"data/nist521.sec"
"card-functionality/data/rsa2k.sec",
"card-functionality/data/rsa3k.sec",
"card-functionality/data/rsa4k.sec",
"card-functionality/data/nist256.sec",
"card-functionality/data/nist384.sec",
"card-functionality/data/nist521.sec"
]

View file

@ -5,8 +5,8 @@
backend.pcsc = "FFFE:43233446"
config.keygen = ["RSA2k", "NIST256", "Curve25519"]
config.import = [
"data/rsa2k.sec",
"data/rsa4k.sec",
"data/nist256.sec",
"data/25519.sec",
"card-functionality/data/rsa2k.sec",
"card-functionality/data/rsa4k.sec",
"card-functionality/data/nist256.sec",
"card-functionality/data/25519.sec",
]

View file

@ -8,11 +8,11 @@ config.keygen = [
"NIST256", "NIST384", "NIST521"
]
config.import = [
"data/rsa2k.sec",
"data/rsa3k.sec",
"data/rsa4k.sec",
"data/nist256.sec",
"data/nist384.sec",
"data/nist521.sec"
"card-functionality/data/rsa2k.sec",
"card-functionality/data/rsa3k.sec",
"card-functionality/data/rsa4k.sec",
"card-functionality/data/nist256.sec",
"card-functionality/data/nist384.sec",
"card-functionality/data/nist521.sec"
]

View file

@ -7,5 +7,5 @@ config.keygen = [
"RSA2k",
]
config.import = [
"data/rsa2k.sec",
"card-functionality/data/rsa2k.sec",
]