From d060a97c548dc2a395be0772f67ee306b3df14a5 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 22 Apr 2022 21:32:54 +0300 Subject: [PATCH] Simplify clippy runs --- .circleci/config.yml | 14 -------------- .github/workflows/testing.yml | 17 ++++++----------- run_clippy.sh | 2 +- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 471d64a82f..3397bcc7b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -132,20 +132,6 @@ jobs: - ~/.cargo/git - target - # Run style checks - # has to run separately from cargo fmt section - # since needs to run with dependencies - - run: - name: cargo clippy - command: | - if [[ $BUILD_TYPE == "debug" ]]; then - cov_prefix=(scripts/coverage "--profraw-prefix=$CIRCLE_JOB" --dir=/tmp/zenith/coverage run) - elif [[ $BUILD_TYPE == "release" ]]; then - cov_prefix=() - fi - - "${cov_prefix[@]}" ./run_clippy.sh - # Run rust unit tests - run: name: cargo test diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 83e46ce6be..6d109b9bb5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -36,8 +36,7 @@ jobs: - name: Install macOs postgres dependencies if: matrix.os == 'macos-latest' - run: | - brew install flex bison + run: brew install flex bison - name: Set pg revision for caching id: pg_ver @@ -53,8 +52,7 @@ jobs: - name: Build postgres if: steps.cache_pg.outputs.cache-hit != 'true' - run: | - make postgres + run: make postgres - name: Cache cargo deps id: cache_cargo @@ -64,13 +62,10 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} - # Use `env CARGO_INCREMENTAL=0` to mitigate https://github.com/rust-lang/rust/issues/91696 for rustc 1.57.0 - - name: Run cargo build - run: | - env CARGO_INCREMENTAL=0 cargo build --workspace --bins --examples --tests + - name: Run cargo clippy + run: ./run_clippy.sh - name: Run cargo test - run: | - env CARGO_INCREMENTAL=0 cargo test -- --nocapture --test-threads=1 + run: cargo test --all --all-targets diff --git a/run_clippy.sh b/run_clippy.sh index 4ca944c1f1..f26dbaa0f3 100755 --- a/run_clippy.sh +++ b/run_clippy.sh @@ -12,4 +12,4 @@ # * `-A unknown_lints` – do not warn about unknown lint suppressions # that people with newer toolchains might use # * `-D warnings` - fail on any warnings (`cargo` returns non-zero exit status) -cargo clippy "${@:2}" --all-targets --all-features --all --tests -- -A unknown_lints -D warnings +cargo clippy --all --all-targets --all-features -- -A unknown_lints -D warnings