From bee9cd13a166f8bb6337fe166a7187d92045f4ff Mon Sep 17 00:00:00 2001 From: dkim19375 <65050767+dkim19375@users.noreply.github.com> Date: Sat, 14 Oct 2023 19:54:14 -0400 Subject: [PATCH] Add rust formatting check --- .github/workflows/check-format.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/check-format.yml diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 0000000..8ae5321 --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,19 @@ +name: Check rust code formatting + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set cargo fmt output + run: export FMT_OUTPUT=$(cargo fmt --message-format short) + - name: Print cargo fmt output + run: echo $FMT_OUTPUT + - name: Check cargo fmt output + run: if [ -z $FMT_OUTPUT ]; then exit 1; fi \ No newline at end of file