From 744519fb2bce544d38e7cc48599e9f75c5d7e78e Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 31 Jan 2025 21:27:41 +0100 Subject: [PATCH] circleci --- .circleci/config.yml | 55 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9becda6..3582901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,21 +12,32 @@ executors: jobs: - rust-init: + cargo-tests: executor: default environment: CARGO_TERM_COLOR: always steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - rust-cache-v1-{{ checksum "Cargo.lock" }} + - rust-cache-v1- - checkout - run: name: Generate testdata command: just testdata - # Persist workspace for other jobs - - persist_to_workspace: - root: . + - run: + name: Run fuzz tests + command: cargo run --release -- -m 100 -t 4 --diff-count 50000 + no_output_timeout: 20m + - save_cache: + key: rust-cache-v1-{{ checksum "Cargo.lock" }} paths: - - . - cargo-tests: + - ~/.cargo + - target + + cargo-lint: executor: default environment: CARGO_TERM_COLOR: always @@ -38,8 +49,31 @@ jobs: - rust-cache-v1-{{ checksum "Cargo.lock" }} - rust-cache-v1- - run: - name: Run fuzz tests - command: cargo run --release -- -m 100 -t 4 --diff-count 50000 + name: Check formatting + command: cargo fmt --all -- --check + - run: + name: Run clippy + command: cargo clippy --workspace --all --locked -- -D warnings + - save_cache: + key: rust-cache-v1-{{ checksum "Cargo.lock" }} + paths: + - ~/.cargo + - target + + cargo-build: + executor: default + environment: + CARGO_TERM_COLOR: always + steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - rust-cache-v1-{{ checksum "Cargo.lock" }} + - rust-cache-v1- + - run: + name: Build project + command: cargo build --workspace --all --locked no_output_timeout: 20m - save_cache: key: rust-cache-v1-{{ checksum "Cargo.lock" }} @@ -75,7 +109,4 @@ workflows: rust-test-workflow: jobs: - - rust-init - - cargo-tests: - requires: - - rust-init + - cargo-tests