Add a GitHub action for rustfmt

Checks formatting against the default `cargo fmt` run.
This commit is contained in:
mitchmindtree 2020-01-20 23:56:04 +01:00
parent aab0d90add
commit cdd49ada2b
1 changed files with 17 additions and 0 deletions

View File

@ -24,6 +24,23 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
args: --all --all-features args: --all --all-features
rustfmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
cargo-publish: cargo-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master' if: github.event_name == 'push' && github.ref == 'refs/heads/master'