Skip to content

Commit

Permalink
actions/cargo: Add a formatting check
Browse files Browse the repository at this point in the history
To enforce a consistent formatting of the code based on the official
`rustfmt` code formatting tool (and custom settings in `rustfmt.toml`).

Signed-off-by: Michael Weiss <michael.weiss@atos.net>
  • Loading branch information
primeos-work committed Jul 11, 2023
1 parent bc782d8 commit 715b827
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ on: [push, pull_request, merge_group]
name: Cargo

jobs:
fmt:
name: Fmt
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3.5.3

- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.65.0 # MSRV
components: rustfmt

- name: Run cargo fmt
run: cargo fmt --check

check:
name: Check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -112,6 +129,7 @@ jobs:
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- fmt
- check
- test
- deny
Expand Down

0 comments on commit 715b827

Please sign in to comment.