From ae7415e6bc5b28f8ff35f368c1c4f9b3b2bd1344 Mon Sep 17 00:00:00 2001 From: PotentialStyx <62217716+PotentialStyx@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:42:59 -0800 Subject: [PATCH] ci(clippy): Enable clippy ci for all pushs & prs --- .github/workflows/clippy.yml | 47 ++++++++++++++++++++++++++++++++++++ rust-toolchain.toml | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/clippy.yml diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..a947063 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,47 @@ +{ + "on": { "push": {}, "pull_request": {} }, + "name": "Clippy", + "permissions": { "security-events": "write" }, + "jobs": + { + "enforce-clippy": + { + "runs-on": "ubuntu-latest", + "steps": + [ + { + "name": "Checkout", + "uses": "actions/checkout@v4", + }, + { + "name": "Install Rust", + "uses": "dtolnay/rust-toolchain@master", + "with": + { + "components": "clippy", + "toolchain": "nightly-2024-01-01", + }, + }, + { + "name": "Cache", + "uses": "Swatinem/rust-cache@v2", + }, + { + "name": "Install tools", + "run": "cargo install clippy-sarif sarif-fmt", + }, + { + "name": "Generate SARIF", + "run": + "cargo clippy --all-features --message-format=json | + clippy-sarif | tee results.sarif | sarif-fmt", + }, + { + "name": "Upload SARIF file", + "uses": "github/codeql-action/upload-sarif@v2", + "with": { "sarif_file": "results.sarif" }, + }, + ], + }, + }, +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5d56faf..4757914 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly" +channel = "nightly-2024-01-01"