From 0485ab1218530611ab2bd30fc67b59bbaaa744cb Mon Sep 17 00:00:00 2001 From: Defnull <879658+define-null@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:04:35 +0100 Subject: [PATCH 1/4] Add workflow for running tests on CI --- .github/workflows/tests.yaml | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..0deac65 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,56 @@ +name: Rust Tests + +on: + push: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +env: + CARGO_TERM_COLOR: always + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test: + name: Test + runs-on: ubuntu-latest + if: github.event_name == 'push' || !github.event.pull_request.draft + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - uses: dtolnay/rust-toolchain@master + - uses: Swatinem/rust-cache@v2 + + - name: Run tests + run: cargo test --workspace --verbose + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + if: github.event_name == 'push' || !github.event.pull_request.draft + steps: + - uses: actions/checkout@v4 + with: + lfs: true + - uses: dtolnay/rust-toolchain@master + with: + components: rustfmt + - run: cargo fmt --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + if: github.event_name == 'push' || !github.event.pull_request.draft + steps: + - uses: actions/checkout@v4 + with: + lfs: true + - uses: dtolnay/rust-toolchain@master + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --all-targets --all-features -- -D warnings From cf786f4b929f9c4ac0f728280518cee793074e07 Mon Sep 17 00:00:00 2001 From: Defnull <879658+define-null@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:06:13 +0100 Subject: [PATCH 2/4] Remove lfs from fmt and clippy --- .github/workflows/tests.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0deac65..537123e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,8 +34,6 @@ jobs: if: github.event_name == 'push' || !github.event.pull_request.draft steps: - uses: actions/checkout@v4 - with: - lfs: true - uses: dtolnay/rust-toolchain@master with: components: rustfmt @@ -47,8 +45,6 @@ jobs: if: github.event_name == 'push' || !github.event.pull_request.draft steps: - uses: actions/checkout@v4 - with: - lfs: true - uses: dtolnay/rust-toolchain@master with: components: clippy From b039cf108c881529051722ea1e13fea84139f964 Mon Sep 17 00:00:00 2001 From: Defnull <879658+define-null@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:14:11 +0100 Subject: [PATCH 3/4] Use action that respects rust-toolchain file --- .github/workflows/tests.yaml | 12 +++--------- rust-toolchain.toml | 1 + 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 537123e..2b35b50 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,10 +21,8 @@ jobs: - uses: actions/checkout@v4 with: lfs: true - - - uses: dtolnay/rust-toolchain@master + - uses: dsherret/rust-toolchain-file@v1 - uses: Swatinem/rust-cache@v2 - - name: Run tests run: cargo test --workspace --verbose @@ -34,9 +32,7 @@ jobs: if: github.event_name == 'push' || !github.event.pull_request.draft steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - components: rustfmt + - uses: dsherret/rust-toolchain-file@v1 - run: cargo fmt --all -- --check clippy: @@ -45,8 +41,6 @@ jobs: if: github.event_name == 'push' || !github.event.pull_request.draft steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - components: clippy + - uses: dsherret/rust-toolchain-file@v1 - uses: Swatinem/rust-cache@v2 - run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4f3e8c5..f018685 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] channel = "1.89" +components = [ "rustfmt", "clippy" ] From cfdb8e6471825735da9a06a1a261058314ed6fb6 Mon Sep 17 00:00:00 2001 From: Defnull <879658+define-null@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:31:02 +0100 Subject: [PATCH 4/4] Introduce reasonable defaults for clippy --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 3dcb0cc..91800b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,3 +48,9 @@ tracing = "0.1.41" tracing-subscriber = "0.3.19" url = "2.5.4" valuable = "0.1.1" + +[workspace.lints.clippy] +all = "warn" +correctness = "deny" +suspicious = "warn" +perf = "warn"