Fix after cargo update
#1720
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: Cargo fmt & clippy | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- develop | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
static_analysis: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Set up Rust toolchain | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
# Cache Rust dependencies | |
- name: Cache Cargo registry and build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
# Install Clippy and other tools | |
- name: Install Clippy and other tools | |
run: | | |
rustup component add clippy | |
cargo install clippy-sarif sarif-fmt | |
# Run cargo fmt to check formatting | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
# Run cargo clippy for linting | |
- name: Run cargo clippy | |
env: | |
SKIP_WASM_BUILD: 1 | |
run: | | |
cargo clippy --all-targets --features private-net,stage,wip,runtime-benchmarks \ | |
--message-format=json -- -D warnings | clippy-sarif | tee results.sarif | sarif-fmt | |
shell: bash | |
# Upload SARIF file for results | |
- name: Upload SARIF file | |
if: always() | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: results.sarif | |
# name: Cargo fmt & clippy | |
# on: | |
# pull_request: | |
# push: | |
# branches: [master, develop] | |
# env: | |
# CARGO_TERM_COLOR: always | |
# jobs: | |
# static_analysis: | |
# runs-on: ubuntu-latest | |
# steps: | |
# # v4.1.1 | |
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
# with: | |
# submodules: 'true' | |
# # v2.1.0 | |
# - uses: arduino/setup-protoc@a8b67ba40b37d35169e222f3bb352603327985b6 | |
# # v2.7.1 | |
# - uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 | |
# with: | |
# # 20GB of cache per repo per week | |
# cache-provider: "buildjet" | |
# # v2.20.16 | |
# - name: cargo install | |
# uses: taiki-e/install-action@ac89944b5b150d78567ab6c02badfbe48b0b55aa | |
# with: | |
# tool: clippy-sarif, sarif-fmt | |
# - name: cargo fmt | |
# run: cargo fmt --check | |
# - name: cargo clippy | |
# env: | |
# SKIP_WASM_BUILD: 1 | |
# run: cargo clippy --all-targets --features private-net,stage,wip,runtime-benchmarks | |
# --message-format=json -- -D warnings | clippy-sarif | tee results.sarif | sarif-fmt | |
# shell: bash | |
# - name: Upload SARIF file | |
# if: always() | |
# # v2.24.2 | |
# uses: github/codeql-action/upload-sarif@49abf0ba24d0b7953cb586944e918a0b92074c80 | |
# with: | |
# sarif_file: results.sarif |