-
Notifications
You must be signed in to change notification settings - Fork 64
46 lines (36 loc) · 1.15 KB
/
rust-code-quality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Assess Rust code quality
on: push
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@v4
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: Update rust
run: rustup update
- name: Install cargo-machete
run: cargo install cargo-machete
continue-on-error: true
- name: Analyze dependencies
run: cargo machete .
- name: Check code format
run: cargo fmt --all -- --check
- name: Run linter
run: cargo clippy -- -A clippy::module_inception