From 1042d07b06fd7486371bb06c048bb507d976f8ce Mon Sep 17 00:00:00 2001 From: chesedo Date: Fri, 22 Jul 2022 18:32:52 +0200 Subject: [PATCH] ci: check crates not in workspace --- .circleci/config.yml | 47 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b66b867a7..fa5f966f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ jobs: - run: cargo fmt --all --check - run: cargo install cargo-sort - run: cargo sort --check --workspace - - run: cargo check --workspace + - run: cargo check --workspace --all-targets - save_cache: key: cargo-{{ checksum "Cargo.lock" }} paths: @@ -41,6 +41,36 @@ jobs: --D warnings \ -A clippy::let-unit-value \ -A clippy::format-push-string + check-standalone: + parameters: + path: + description: "Path to crate excluded from workspace" + type: string + docker: + - image: cimg/rust:1.62.0 + steps: + - checkout + - restore_cache: + keys: + - cargo-{{ checksum "Cargo.lock" }} + - run: + name: Patch service + command: | + cat\<< EOF > ~/.cargo/config.toml + [patch.crates-io] + shuttle-service = { path = "$PWD/service" } + EOF + - run: cargo fmt --all --check --manifest-path << parameters.path >>/Cargo.toml + - run: cargo install cargo-sort + - run: cargo sort --check << parameters.path >> + - run: | + cargo clippy --tests \ + --all-targets \ + --manifest-path << parameters.path >>/Cargo.toml \ + --no-deps -- \ + --D warnings \ + -A clippy::let-unit-value \ + -A clippy::format-push-string build-test-and-push: resource_class: xlarge @@ -118,6 +148,21 @@ workflows: matrix: parameters: framework: ["web-axum", "web-rocket", "web-tide", "web-tower"] + - check-not-in-workspace: + requires: + - clippy-workspace + matrix: + parameters: + framework: + - examples/axum/hello-world + - examples/axum/websocket + - examples/rocket/authentication + - examples/rocket/hello-world + - examples/rocket/postgres + - examples/rocket/url-shortener + - examples/tide/hello-world + - examples/tide/postgres + - examples/tower/hello-world # build-test-and-push: # jobs: # - build-test-and-push