ci: check code formats

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-25 09:40:51 +02:00
parent 4cfc7b972b
commit 6c20c622f3

View File

@ -274,3 +274,28 @@ jobs:
# with:
# name: 'ouch-x86_64-pc-windows-gnu'
# path: target\x86_64-pc-windows-gnu\release\ouch.exe
fmt:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
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