From 8d084b1ccf292806973f56cafd5662fdb1ff67c8 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 31 Oct 2024 10:44:36 +0400 Subject: [PATCH] fix merge --- .github/workflows/check-rust.yml | 44 +++++++++++++++----------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/check-rust.yml b/.github/workflows/check-rust.yml index 73a402fc5..80d543163 100644 --- a/.github/workflows/check-rust.yml +++ b/.github/workflows/check-rust.yml @@ -113,8 +113,8 @@ jobs: - name: cargo clippy --workspace --all-targets -- -D warnings run: cargo clippy --workspace --all-targets -- -D warnings - cargo-clippy-all-features: - name: cargo clippy --all-features + cargo-check-lints: + name: check custom lints runs-on: SubtensorCI strategy: matrix: @@ -122,24 +122,21 @@ jobs: - stable rust-target: - x86_64-unknown-linux-gnu - # - x86_64-apple-darwin + # - x86_64-apple-darwin os: - ubuntu-latest # - macos-latest - include: - - os: ubuntu-latest - # - os: macos-latest env: RELEASE_NAME: development - # RUSTFLAGS: -A warnings RUSTV: ${{ matrix.rust-branch }} + RUSTFLAGS: -D warnings RUST_BACKTRACE: full RUST_BIN_DIR: target/${{ matrix.rust-target }} SKIP_WASM_BUILD: 1 TARGET: ${{ matrix.rust-target }} steps: - name: Check-out repository under $GITHUB_WORKSPACE - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: | @@ -158,12 +155,14 @@ jobs: with: key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} - - name: cargo clippy --workspace --all-targets --all-features -- -D warnings - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + - name: check lints + run: | + set -o pipefail + cargo check 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g" | grep "warning:" && exit 1 + echo "No warnings found." - # runs cargo test --workspace - cargo-test: - name: cargo test + cargo-clippy-all-features: + name: cargo clippy --all-features runs-on: SubtensorCI strategy: matrix: @@ -188,7 +187,7 @@ jobs: TARGET: ${{ matrix.rust-target }} steps: - name: Check-out repository under $GITHUB_WORKSPACE - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Install dependencies run: | @@ -202,17 +201,17 @@ jobs: components: rustfmt, clippy profile: minimal - - name: Utilize Rust shared cached + - name: Utilize Shared Rust Cache uses: Swatinem/rust-cache@v2.2.1 with: key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} - - name: cargo test --workspace - run: cargo test --workspace + - name: cargo clippy --workspace --all-targets --all-features -- -D warnings + run: cargo clippy --workspace --all-targets --all-features -- -D warnings - # runs cargo test --workspace --features=runtime-benchmarks - cargo-test-benchmarks: - name: cargo test w/benchmarks + # runs cargo test --workspace + cargo-test: + name: cargo test runs-on: SubtensorCI strategy: matrix: @@ -256,8 +255,8 @@ jobs: with: key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} - - name: cargo test --workspace --features=runtime-benchmarks - run: cargo test --workspace --features=runtime-benchmarks + - name: cargo test --workspace --all-features + run: cargo test --workspace --all-features # ensures cargo fix has no trivial changes that can be applied cargo-fix: @@ -339,4 +338,3 @@ jobs: - name: Check features run: zepter run check -