From 39c8d21ea7092992d2ee3351e05cef90a9a3a362 Mon Sep 17 00:00:00 2001 From: feltroid Prime <96737978+feltroidprime@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:32:21 +0700 Subject: [PATCH] CI: Force `make rewrite` to be synced with committed files. (#236) --- .github/workflows/hydra.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/hydra.yml b/.github/workflows/hydra.yml index 95faed9c..5e1c0149 100644 --- a/.github/workflows/hydra.yml +++ b/.github/workflows/hydra.yml @@ -30,6 +30,7 @@ jobs: toolchain: stable override: true profile: minimal + components: rustfmt - uses: actions/checkout@v3 - name: Set up Python 3.10.14 @@ -50,3 +51,19 @@ jobs: run: | source venv/bin/activate pytest -n auto + - name: Set up Scarb + uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.2" + - name: Run make rewrite and check for unstaged changes + run: | + source venv/bin/activate + if ! make rewrite; then + echo "Error: 'make rewrite' command failed" + exit 1 + fi + if [[ -n $(git status --porcelain) ]]; then + echo "Error: Unstaged changes detected after running 'make rewrite'" + git status + exit 1 + fi