From 41dac5e2d1434cd1be431468ff1192bb88130ef4 Mon Sep 17 00:00:00 2001 From: Micah Elizabeth Scott Date: Mon, 14 Aug 2023 13:13:36 -0700 Subject: CI: Add Rust tests and clippy This adds a new "rust-latest" CI target that runs tests and clippy for everything in the workspace. It's a subset of the equivalent on Arti. --- .gitlab-ci.yml | 16 ++++++++++++++++ changes/rust_ci | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 changes/rust_ci diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 789f6c4840..45142671aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -253,3 +253,19 @@ debian-packaging-0.4.6: rules: - if: $CI_PROJECT_NAMESPACE == "tpo/core" && $CI_COMMIT_BRANCH == "maint-0.4.6" + +##### +# Run tests written in Rust, and run clippy on all Rust code here. +rust-latest: + image: rust:latest + <<: *debian-template + script: + - apt-get install llvm-dev libclang-dev clang + - rustup show + - cargo build --locked --verbose + - cargo test --verbose + - rustup component add clippy + - rustup show + - cargo clippy --all-features --all-targets -- -D warnings + after_script: + - cargo clean \ No newline at end of file diff --git a/changes/rust_ci b/changes/rust_ci new file mode 100644 index 0000000000..868f94fd91 --- /dev/null +++ b/changes/rust_ci @@ -0,0 +1,4 @@ + o Minor features (testing): + - All Rust code is now linted (cargo clippy) as part of GitLab CI, + and existing warnings have been fixed. + - Any unit tests written in Rust now run as part of GitLab CI. -- cgit v1.2.3-54-g00ecf