diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c028a2..5ead700 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,36 @@ jobs: - name: Validate config run: cargo run config example.config.toml + # TODO merge `fmt` back in after https://github.com/clap-rs/clap/issues/4733 is fixed + # and restore `clippy` to `+nightly` lint: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Read toolchain file + id: rust-toolchain + run: | + RUST_TOOLCHAIN=$(grep 'channel' rust-toolchain.toml | awk '{split($0,a," = "); print a[2]}' | tr -d '"') + echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> $GITHUB_OUTPUT + shell: bash + + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.rust-toolchain.outputs.RUST_TOOLCHAIN }} + components: clippy + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - name: Check clippy + run: cargo clippy --all-targets --all-features --all --verbose -- -D warnings + + fmt: runs-on: ubuntu-latest steps: - name: Checkout sources @@ -51,7 +80,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@nightly with: - components: rustfmt, clippy + components: rustfmt - name: Rust cache uses: Swatinem/rust-cache@v2 @@ -60,6 +89,3 @@ jobs: - name: Check format run: cargo +nightly fmt --all --check - - - name: Check clippy - run: cargo +nightly clippy --all-targets --all-features --all --verbose -- -D warnings diff --git a/justfile b/justfile index a8499f8..01d5d87 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,8 @@ test: fmt: cargo +nightly fmt --all lint: fmt validate-example-config - cargo +nightly clippy --all-targets --all-features --all + # TODO restore +nightly after fixing this: https://github.com/clap-rs/clap/issues/4733 + cargo clippy --all-targets --all-features --all build: cargo build --all-targets --all-features --all run-ci: lint build test run-integration-tests