Check the format with Github Action (#126)

* Add cargo fmt to the CI

Use a job to check the format of the sourcecode with `cargo fmt`
command. The new step does not change any code, but returns an error
when `check` does not pass with 0 issues.
This commit is contained in:
Santo Cariotti 2021-10-27 15:58:31 +02:00 committed by GitHub
parent 4cfc7b972b
commit 01b6dc89de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,3 +274,26 @@ jobs:
# with:
# name: 'ouch-x86_64-pc-windows-gnu'
# path: target\x86_64-pc-windows-gnu\release\ouch.exe
fmt:
name: Check sourcecode format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: x86_64-unknown-linux-musl
components: rustfmt
override: true
- name: Check format with cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check