summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/rustfmt.yml
blob: 900d5ed974aa60b536ac10da0923c0fc78fb3019 (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
name: Rust formatting check CI
on:
    # Check whenever a file that affects Rust formatting is changed in a pull request
    pull_request:
        paths:
            - .github/workflows/rustfmt.yml
            - rustfmt.toml
            - '**/*.rs'
    # Check if requested manually from the Actions tab
    workflow_dispatch:
jobs:
    check-formatting:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout repository
              uses: actions/checkout@v2

            - name: Install nightly Rust
              uses: ATiltedTree/setup-rust@v1.0.4
              with:
                rust-version: nightly
                components: rustfmt

            - name: Check formatting
              run: |
                rustfmt --version
                cargo fmt -- --check --unstable-features