-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (66 loc) · 1.82 KB
/
linter.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: linter
permissions:
contents: read
on:
push:
paths:
- ".github/workflows/linter.yml"
- "**.rs"
- "**.toml"
- "**/Cargo.lock"
- "**/Makefile"
branches: [ "main" ]
pull_request:
paths:
- ".github/workflows/linter.yml"
- "**.rs"
- "**.toml"
- "**/Cargo.lock"
- "**/Makefile"
branches: [ "main" ]
workflow_dispatch:
inputs:
commit_sha:
description: Git commit sha, on which, to run this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
lint_commits:
name: Lint Commit Messages
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check Commit Lint
uses: wagoid/commitlint-github-action@v5.4.5
lint_check:
name: Rust - lint_${{ matrix.lint_projects }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
lint_projects:
- cargo_fmt_check
- cargo_clippy
- cargo_deny
- cargo_toml_files
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install cargo-deny
run: cargo install --locked cargo-deny && cargo deny init && cargo deny check || true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sdk-rust-
- name: Check cargo version
run: cargo --version
- name: Run lint ${{ matrix.lint_projects }}
run: make -f Makefile lint_${{ matrix.lint_projects }}