Merge branch 'nora/subplot-ci' into 'main'
CI fixes See merge request openpgp-card/openpgp-card!13
This commit is contained in:
commit
fe61a398a9
1 changed files with 49 additions and 11 deletions
|
@ -21,6 +21,10 @@ cache: &general_cache_config
|
||||||
- target/
|
- target/
|
||||||
- $CARGO_HOME
|
- $CARGO_HOME
|
||||||
|
|
||||||
|
.report-rust: &report-rust
|
||||||
|
- cargo --version
|
||||||
|
- rustc --version
|
||||||
|
|
||||||
reuse:
|
reuse:
|
||||||
stage: lint
|
stage: lint
|
||||||
image:
|
image:
|
||||||
|
@ -34,8 +38,10 @@ reuse:
|
||||||
cargo-fmt:
|
cargo-fmt:
|
||||||
stage: lint
|
stage: lint
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
script:
|
before_script:
|
||||||
- rustup component add rustfmt
|
- rustup component add rustfmt
|
||||||
|
- *report-rust
|
||||||
|
script:
|
||||||
- cargo fmt -- --check
|
- cargo fmt -- --check
|
||||||
cache: [ ]
|
cache: [ ]
|
||||||
|
|
||||||
|
@ -44,6 +50,7 @@ cargo-deny:
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
before_script:
|
before_script:
|
||||||
- cargo install --locked cargo-deny
|
- cargo install --locked cargo-deny
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- cargo deny check
|
- cargo deny check
|
||||||
cache: [ ]
|
cache: [ ]
|
||||||
|
@ -56,9 +63,9 @@ cargo-clippy:
|
||||||
- apt update -y -qq
|
- 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 install -y -qq --no-install-recommends git clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev
|
||||||
- apt clean
|
- apt clean
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- rustup component add clippy
|
- rustup component add clippy
|
||||||
- rm tools/tests/opgpcard.rs # otherwise build fails
|
|
||||||
- cargo clippy --verbose --tests -- -D warnings
|
- cargo clippy --verbose --tests -- -D warnings
|
||||||
cache:
|
cache:
|
||||||
# inherit all general cache settings
|
# inherit all general cache settings
|
||||||
|
@ -77,22 +84,21 @@ udeps:
|
||||||
- curl --location --output /tmp/cargo-udeps.tar.gz https://github.com/est31/cargo-udeps/releases/download/v0.1.26/cargo-udeps-v0.1.26-x86_64-unknown-linux-gnu.tar.gz
|
- curl --location --output /tmp/cargo-udeps.tar.gz https://github.com/est31/cargo-udeps/releases/download/v0.1.26/cargo-udeps-v0.1.26-x86_64-unknown-linux-gnu.tar.gz
|
||||||
- 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:
|
||||||
- rm tools/tests/opgpcard.rs # otherwise build fails
|
|
||||||
- cargo udeps --workspace --all-features --all-targets
|
- cargo udeps --workspace --all-features --all-targets
|
||||||
cache: [ ]
|
cache: [ ]
|
||||||
|
|
||||||
cargo-test:
|
cargo-test:
|
||||||
stage: test
|
stage: test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps
|
image: rust:latest
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p /run/user/$UID
|
- mkdir -p /run/user/$UID
|
||||||
- apt update -y -qq
|
- 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 install -y -qq --no-install-recommends git clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev
|
||||||
- apt clean
|
- apt clean
|
||||||
- /etc/init.d/pcscd start
|
- *report-rust
|
||||||
- su - -c "sh /home/jcardsim/run-card.sh >/dev/null" jcardsim
|
|
||||||
script:
|
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
|
- cargo test
|
||||||
cache:
|
cache:
|
||||||
# inherit all general cache settings
|
# inherit all general cache settings
|
||||||
|
@ -102,16 +108,16 @@ cargo-test:
|
||||||
|
|
||||||
cargo-test-debian-bookworm:
|
cargo-test-debian-bookworm:
|
||||||
stage: test
|
stage: test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps
|
image: debian:bookworm-slim
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p /run/user/$UID
|
- mkdir -p /run/user/$UID
|
||||||
- apt update -y -qq
|
- 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 install -y -qq --no-install-recommends git rustc cargo clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev
|
||||||
- apt clean
|
- apt clean
|
||||||
- /etc/init.d/pcscd start
|
- *report-rust
|
||||||
- su - -c "sh /home/jcardsim/run-card.sh >/dev/null" jcardsim
|
|
||||||
script:
|
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
|
- cargo test
|
||||||
cache:
|
cache:
|
||||||
# inherit all general cache settings
|
# inherit all general cache settings
|
||||||
|
@ -119,9 +125,33 @@ cargo-test-debian-bookworm:
|
||||||
# override the key
|
# override the key
|
||||||
key: "bookworm"
|
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
|
||||||
|
- *report-rust
|
||||||
|
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:
|
run_cardtest_smartpgp:
|
||||||
stage: virtual-test
|
stage: virtual-test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps
|
image: registry.gitlab.com/openpgp-card/virtual-cards/smartpgp-builddeps
|
||||||
|
before_script:
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- sh /start.sh
|
- sh /start.sh
|
||||||
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
||||||
|
@ -140,6 +170,8 @@ run_cardtest_smartpgp:
|
||||||
run_cardtest_opcard_rs:
|
run_cardtest_opcard_rs:
|
||||||
stage: virtual-test
|
stage: virtual-test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/opcard-rs-builddeps
|
image: registry.gitlab.com/openpgp-card/virtual-cards/opcard-rs-builddeps
|
||||||
|
before_script:
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- sh /start.sh
|
- sh /start.sh
|
||||||
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
||||||
|
@ -158,6 +190,8 @@ run_cardtest_opcard_rs:
|
||||||
run_cardtest_ykneo:
|
run_cardtest_ykneo:
|
||||||
stage: virtual-test
|
stage: virtual-test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/ykneo-builddeps
|
image: registry.gitlab.com/openpgp-card/virtual-cards/ykneo-builddeps
|
||||||
|
before_script:
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- sh /start.sh
|
- sh /start.sh
|
||||||
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
||||||
|
@ -176,6 +210,8 @@ run_cardtest_ykneo:
|
||||||
run_cardtest_fluffypgp:
|
run_cardtest_fluffypgp:
|
||||||
stage: virtual-test
|
stage: virtual-test
|
||||||
image: registry.gitlab.com/openpgp-card/virtual-cards/fluffypgp-builddeps
|
image: registry.gitlab.com/openpgp-card/virtual-cards/fluffypgp-builddeps
|
||||||
|
before_script:
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- sh /start.sh
|
- sh /start.sh
|
||||||
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
- RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status
|
||||||
|
@ -233,6 +269,8 @@ hardware-builddeps:
|
||||||
- "card-functionality/ci/nitro-pro1.toml"
|
- "card-functionality/ci/nitro-pro1.toml"
|
||||||
- "card-functionality/ci/nitro-pro2.toml"
|
- "card-functionality/ci/nitro-pro2.toml"
|
||||||
- "card-functionality/ci/nitro-start.toml"
|
- "card-functionality/ci/nitro-start.toml"
|
||||||
|
before_script:
|
||||||
|
- *report-rust
|
||||||
script:
|
script:
|
||||||
- RUST_BACKTRACE=1 RUST_LOG=debug cargo run --bin $ARG -- $CONFIG
|
- RUST_BACKTRACE=1 RUST_LOG=debug cargo run --bin $ARG -- $CONFIG
|
||||||
cache:
|
cache:
|
||||||
|
|
Loading…
Reference in a new issue