diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8debeeda44..6602b6703f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,3 +76,17 @@ jobs: raco pkg install --auto || raco setup forge - name: Run Tests run: cargo test --test external_annotation_tests + format-check: + name: Format Control + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + # just triggers rustup to download the toolchain + - name: Cache Toolchain + uses: actions/cache@v3 + with: + path: ~/.rustup + key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }} + - name: Perform Check + run: cargo fmt --check diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 910719febd..ec60f6d59a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] channel = "nightly-2023-04-12" -components = ["rustc-dev", "rust-src"] +components = ["rustc-dev", "rust-src", "rustfmt"] # You are probably looking at this because you got an error that the toolchain # that was configured does not exist,