From 369a22f75d714929a5f5d829b921494710112610 Mon Sep 17 00:00:00 2001 From: Olivier Desenfans Date: Fri, 23 Feb 2024 12:13:55 +0100 Subject: [PATCH] CI: run `cargo fmt` early The format check should occur as soon as possible to avoid wasting time. --- .github/workflows/tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 350fdb8..37bd32d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,6 +47,9 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- + - name: Cargo fmt + run: cargo fmt --check + - name: Log in to Github container registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin @@ -56,16 +59,12 @@ jobs: cache_image=$(echo ghcr.io/${GITHUB_REPOSITORY}/build-cache | tr '[:upper:]' '[:lower:]') echo "STONE_PROVER_DOCKER_CACHE=$(echo ${cache_image})" >> $GITHUB_ENV - - name: Download Docker cache image (if available) run: docker pull ${STONE_PROVER_DOCKER_CACHE} || true - name: Build run: cargo build --verbose - - name: Cargo fmt - run: cargo fmt --check - - name: Lint with Clippy run: cargo clippy -- -D warnings