Fix GitHub Actions & Add Format Checks #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: checks | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "**" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Cargo Cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Install SARIF tools | |
run: cargo install clippy-sarif sarif-fmt | |
- name: Run Clippy | |
run: > | |
cargo clippy --all-features --all --message-format=json | |
| clippy-sarif | |
| tee clippy-results.sarif | |
| sarif-fmt | |
continue-on-error: true | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: clippy-results.sarif | |
wait-for-processing: true | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Run Rustfmt | |
run: cargo fmt --check |