• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Rust linting, formatting and audit
2on:
3  pull_request:
4    paths:
5      - .github/workflows/*.yml
6      - '**/*.rs'
7      - Cargo.toml
8      - Cargo.lock
9  workflow_dispatch:
10jobs:
11  clippy-linting:
12    runs-on: ubuntu-latest
13    steps:
14      - uses: actions/checkout@v3
15
16      - uses: actions-rs/toolchain@v1.0.6
17        with:
18          toolchain: stable
19          components: clippy
20          override: true
21
22      - name: Clippy check
23        run: |
24          export RUSTFLAGS="--deny warnings"
25          time cargo clippy --verbose
26
27  check-formatting:
28    runs-on: ubuntu-latest
29    steps:
30      - uses: actions/checkout@v3
31
32      - uses: actions-rs/toolchain@v1.0.6
33        with:
34          toolchain: stable
35          components: rustfmt
36          override: true
37
38      - name: Check formatting
39        run: |
40          rustfmt --version
41          cargo fmt -- --check
42
43  audit:
44    runs-on: ubuntu-latest
45    steps:
46      - uses: actions/checkout@v3
47
48      - name: Install cargo-audit
49        uses: actions-rs/install@v0.1.2
50        with:
51          crate: cargo-audit
52          version: latest
53
54      - name: Audit
55        run: cargo audit
56