Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add clippy results to GitHub code scans #9318

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Scan the code in this repository; publish results to
# https://github.com/bytecodealliance/wasmtime/security/code-scanning.

name: Code Scan

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "4 3 * * 2"

permissions:
contents: read

jobs:
analyze:
name: Analyze (Rust)
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
env:
CARGO_NDK_VERSION: 2.12.2
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true

- uses: ./.github/actions/install-rust

- name: Install clippy
run: rustup component add clippy

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@3a99ae3c155195e5518c9ff954bee1b90f98b82c # v1.10.6

- name: Install dependencies
run: cargo binstall --no-confirm clippy-sarif sarif-fmt

- name: Run clippy
run: |
cargo clippy --workspace --all-targets --message-format=json > clippy.json
clippy-sarif --input clippy.json --output clippy.sarif
sarif-fmt --input clippy.sarif
continue-on-error: true

- name: Upload analysis
uses: github/codeql-action/upload-sarif@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # v2.19.0
with:
sarif_file: clippy.sarif
wait-for-processing: true
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ manual_strip = 'warn'
unnecessary_mut_passed = 'warn'
unnecessary_fallible_conversions = 'warn'
unnecessary_cast = 'warn'
question_mark = 'warn'

[workspace.dependencies]
arbitrary = { version = "1.3.1" }
Expand Down
Loading