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"