From 043f3381b094374c62dc15ae21c3e9d3bea21735 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 4 Oct 2021 08:08:14 +0200 Subject: [PATCH] CICD: Make the 'cargo fmt' check a toplevel job (#1883) Mainly to make it easier to see what went wrong when it fails. If this ever gets of out sync with a particular Rust version, we can most likely save the situation by introducing a `rustfmt.toml` file. --- .github/workflows/CICD.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index b2c28edd..a4107768 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -14,6 +14,19 @@ on: - '*' jobs: + ensure_cargo_fmt: + name: Ensure 'cargo fmt' has been run + runs-on: ubuntu-20.04 + steps: + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + profile: minimal + components: rustfmt + - uses: actions/checkout@v2 + - run: cargo fmt -- --check + min_version: name: Minimum supported rust version runs-on: ubuntu-20.04 @@ -27,12 +40,7 @@ jobs: toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }} default: true profile: minimal # minimal component installation (ie, no documentation) - components: clippy, rustfmt - - name: Ensure `cargo fmt` has been run - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + components: clippy - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix) uses: actions-rs/cargo@v1 with: