on master help sign in
CICD: Make the 'cargo fmt' check a toplevel job (#1883)
043f338Martin Nordholts
.github/workflows/CICD.yml+14−6
@@ -14,6 +14,19 @@ on:
14 - '*'
14 - '*'
15
15
16jobs:
16jobs:
17+ ensure_cargo_fmt:
18+ name: Ensure 'cargo fmt' has been run
19+ runs-on: ubuntu-20.04
20+ steps:
21+ - uses: actions-rs/toolchain@v1
22+ with:
23+ toolchain: stable
24+ default: true
25+ profile: minimal
26+ components: rustfmt
27+ - uses: actions/checkout@v2
28+ - run: cargo fmt -- --check
29+
17 min_version:
30 min_version:
18 name: Minimum supported rust version
31 name: Minimum supported rust version
19 runs-on: ubuntu-20.04
32 runs-on: ubuntu-20.04
@@ -27,12 +40,7 @@ jobs:
27 toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
40 toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
28 default: true
41 default: true
29 profile: minimal # minimal component installation (ie, no documentation)
42 profile: minimal # minimal component installation (ie, no documentation)
30− components: clippy, rustfmt
43+ components: clippy
31− - name: Ensure `cargo fmt` has been run
32− uses: actions-rs/cargo@v1
33− with:
34− command: fmt
35− args: -- --check
36 - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
44 - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
37 uses: actions-rs/cargo@v1
45 uses: actions-rs/cargo@v1
38 with:
46 with: