Skip to content

ci: use setup-rust-toolchain action #8

ci: use setup-rust-toolchain action

ci: use setup-rust-toolchain action #8

Workflow file for this run

name: Lint
on:
pull_request:
paths: ["**.rs", "**.toml", "**.lock"]
push:
branches: [main]
paths: ["**.rs", "**.toml", "**.lock"]
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }}-test
- run: cargo install clippy-sarif sarif-fmt
- name: clippy
run: cargo clippy --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
- name: rustfmt check
run: cargo fmt --all --check
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif