diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7a522f826..5a8c5832d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -105,9 +105,30 @@ jobs: # Keep the name 'udeps' to match original action name, so we don't need to define specific branch # rules on Github for specific version branches. - udeps: + machete: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run Machete (detect unused dependencies) uses: bnjbvr/cargo-machete@main + + + udeps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + name: "Rust Toolchain Setup" + with: + toolchain: nightly-2024-01-12 + - uses: Swatinem/rust-cache@v2 + - uses: Noelware/setup-protoc@1.1.0 + with: + version: ${{env.PROTOC_VERSION}} + + - name: "Download and run cargo-udeps" + run: | + wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz + cargo-udeps-*/cargo-udeps udeps + env: + RUSTUP_TOOLCHAIN: nightly-2024-01-12 diff --git a/.github/workflows/papyrus_ci.yml b/.github/workflows/papyrus_ci.yml index 98c8ed7fd7..a842507052 100644 --- a/.github/workflows/papyrus_ci.yml +++ b/.github/workflows/papyrus_ci.yml @@ -125,44 +125,6 @@ jobs: - run: cargo +nightly-2024-01-12 fmt --all -- --check - udeps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - name: "Rust Toolchain Setup" - with: - toolchain: nightly-2024-01-12 - - uses: Swatinem/rust-cache@v2 - - uses: Noelware/setup-protoc@1.1.0 - with: - version: ${{env.PROTOC_VERSION}} - - - name: "Download and run cargo-udeps" - run: | - wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz - cargo-udeps-*/cargo-udeps udeps - env: - RUSTUP_TOOLCHAIN: nightly-2024-01-12 - - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - uses: Swatinem/rust-cache@v2 - - uses: Noelware/setup-protoc@1.1.0 - with: - version: ${{env.PROTOC_VERSION}} - - - run: echo "Skipping clippy for now" - - run: > - cargo clippy --workspace --all-targets --all-features -- -D warnings - -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused - -D clippy::unwrap_used -A clippy::blocks_in_conditions # This is because of a bug in tracing: https://github.com/tokio-rs/tracing/issues/2876 - doc: runs-on: ubuntu-latest env: diff --git a/scripts/clippy.sh b/scripts/clippy.sh index 82d240a763..7ca2f22768 100755 --- a/scripts/clippy.sh +++ b/scripts/clippy.sh @@ -1,3 +1,10 @@ #!/bin/bash -cargo clippy "$@" --all-targets --all-features +# TODO: Revert clippy::unwrap_used to -D after fixing all the unwraps. +cargo clippy --workspace --all-targets --all-features -- \ + -D future-incompatible \ + -D nonstandard-style \ + -D rust-2018-idioms \ + -D unused \ + -A clippy::unwrap_used \ + -A clippy::blocks_in_conditions # This is because of a bug in tracing: https://github.com/tokio-rs/tracing/issues/2876