nitrokey-test 0.5.0

Supporting test infrastructure for the nitrokey crate and others using it.
Documentation
# The documentation for the contents of this file can be found at:
# https://docs.gitlab.com/ce/ci/yaml/README.html

# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
# The recipe for this docker image can be found at:
# https://github.com/rust-lang/docker-rust/blob/8bab191937fcf23569d3a3c31103c1c6f7f2947e/1.42.0/buster/Dockerfile
image: "rust:1.42.0"

build-test:cargo:
  script:
  - apt-get update
  - apt-get install --assume-yes libudev-dev libhidapi-dev
  - rustc --version && cargo --version
  - cargo build --lib --tests --verbose
  - cargo build --lib --tests --verbose --release
  - cargo test --verbose

lint:clippy:
  script:
  - rustup component add clippy
  # First check and build everything but be very permissive. Then clean
  # only the artifacts of the package we are interested in. Lastly check
  # once more, but with warnings turned to errors. This last run will
  # only recheck the current crate (everything else is still
  # up-to-date). That procedure is necessary because consumed
  # dependencies may emit errors otherwise.
  - cargo clippy --all-targets --all-features -- -A clippy::all
  - cargo clean --package=nitrokey-test
  - cargo clippy --all-targets --all-features -- -A unknown_lints -D warnings