WIP WIP #137
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Assess Rust code quality | |
on: | |
push: | |
paths: | |
- ".github/workflows/rust-code-quality.yml" | |
- "offchain/**" | |
jobs: | |
assess-rust-code-quality: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: offchain | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
offchain/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Install protoc | |
run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev | |
- name: Install cargo-machete | |
run: cargo install cargo-machete | |
continue-on-error: true | |
- name: Analyze dependencies | |
run: cargo machete . | |
- name: Install rustfmt | |
run: rustup component add rustfmt | |
- name: Check code format | |
run: cargo fmt --all -- --check | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Run linter | |
run: cargo clippy -- -A clippy::module_inception |