From afd0e1920eee66dff6cf0b1e2da84915bef7b17b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 11 Apr 2024 10:47:55 +0200 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 17 +++++++++++++++++ Makefile | 26 ++++++++++++++++++++++++++ src/core_api.rs | 8 ++++---- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 Makefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..66f6500 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +# Copyright (C) Nitrokey GmbH +# SPDX-License-Identifier: CC0-1.0 + +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Install rust + run: rustup show + - name: Execute checks + run: make ci diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b4062ec --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +# Copyright (C) Nitrokey GmbH +# SPDX-License-Identifier: CC0-1.0 + +.PHONY: all +all: check lint test + +.PHONY: check +check: + cargo check --all-targets + cargo check --all-targets --no-default-features + cargo check --all-targets --all-features + +.PHONY: lint +lint: + cargo clippy --all-targets --all-features + cargo fmt -- --check + cargo doc --all-features --no-deps + +.PHONY: test +test: + cargo test --all-features + +.PHONY: ci +ci: export RUSTFLAGS=-Dwarnings +ci: export RUSTDOCFLAGS=-Dwarnings +ci: check lint test diff --git a/src/core_api.rs b/src/core_api.rs index e4e726f..d3ee366 100644 --- a/src/core_api.rs +++ b/src/core_api.rs @@ -2065,11 +2065,11 @@ impl> Se050Backend { }; debug!("trussed: Chacha8Poly1305::WrapKey {:?}", req.key); match parsed_key { - ParsedObjectId::VolatileKey(id) => { - debug!("Id: {:?}", id.0); + ParsedObjectId::VolatileKey(_id) => { + debug!("Id: {:?}", _id.0); } - ParsedObjectId::VolatileRsaKey(id) => { - debug!("Rsa Ids: {:?}", (id.key_id(), id.intermediary_key_id())); + ParsedObjectId::VolatileRsaKey(_id) => { + debug!("Rsa Ids: {:?}", (_id.key_id(), _id.intermediary_key_id())); } _ => unreachable!(), }