aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/linting.yml
blob: 685b93a33ab7d4dc024d435b19678d84c528af41 (plain)
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
name: Linting
on: [push, pull_request]

jobs:
  dependency-lint:
    name: Dependency linting
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: EmbarkStudios/cargo-deny-action@v1
        with:
          arguments: --all-features
          command-arguments: --allow license-not-encountered
  code-lint:
    name: Code linting
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: nightly
          components: clippy, rust-src
      - run: cargo clippy --all-features -- --deny warnings
  code-format:
    name: Check formatting
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: nightly
          components: rustfmt, rust-src
      - run: cargo fmt -- --check