From 097849f42496bcae622a8f3467c76670b0c0f665 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 10 Dec 2021 11:29:22 +0100 Subject: [PATCH 1/4] Switch to clippy and add tarpaulin coverage --- .gitlab-ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03bb431..481cfe0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,18 +9,24 @@ stages: check: script: - - cargo check --all --tests --all-features + - cargo clippy --all --tests --all-features only: - tags - master test: script: - - cargo test --all --all-features + - cargo install cargo-tarpaulin + - cargo tarpaulin --all --all-features + coverage: '/^\d+.\d+% coverage/' + artifacts: + reports: + cobertura: + - cobertura.xml only: - tags - master cache: paths: - - target/debug \ No newline at end of file + - target/debug From 3b7c6ff9332161f4422967603e13bb3ef307935e Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 10 Dec 2021 11:33:45 +0100 Subject: [PATCH 2/4] Add CI cache --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 481cfe0..19f38fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,16 +8,25 @@ stages: - test check: + stage: check script: + - rustup component add clippy - cargo clippy --all --tests --all-features + cache: + paths: + - target/ only: - tags - master test: + stage: test script: - cargo install cargo-tarpaulin - cargo tarpaulin --all --all-features + cache: + paths: + - target/ coverage: '/^\d+.\d+% coverage/' artifacts: reports: From 902dda404df1340d973f8b37f3d8467a47d770b5 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 10 Dec 2021 11:43:04 +0100 Subject: [PATCH 3/4] Test cleanup --- src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests.rs b/src/tests.rs index 89a6e75..0cebfae 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -7,7 +7,7 @@ use crate::types::HashFunction; #[test] fn test_sbf() -> Result<(), Box> { - let mut sbf = SBF::new(10 as u8, 2, 5, + let mut sbf = SBF::new(10u8, 2, 5, HashFunction::MD5, 3)?; #[cfg(feature = "serde_support")] { println!("{}", serde_json::to_string(&sbf)?); @@ -59,4 +59,4 @@ fn test_sbf() -> Result<(), Box> { } Ok(()) -} \ No newline at end of file +} From ee007efb8e606bff96cbbfad8d6bc6c816c18241 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 10 Dec 2021 11:50:04 +0100 Subject: [PATCH 4/4] Better caches --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19f38fb..7219f34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,8 @@ check: cache: paths: - target/ + - ~/.cargo/git + - ~/.cargo/registry only: - tags - master @@ -27,6 +29,8 @@ test: cache: paths: - target/ + - ~/.cargo/git + - ~/.cargo/registry coverage: '/^\d+.\d+% coverage/' artifacts: reports: