From 5f6464821cc2be2098cf9d5bd958fef3e3747511 Mon Sep 17 00:00:00 2001 From: danijelTxFusion Date: Fri, 22 Dec 2023 05:21:14 +0100 Subject: [PATCH] ci: fix validation and test workflows --- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8ac317..0224432 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: with: go-version: 1.20 - name: Install dependencies - run: go mod tidy + run: go mod download - name: Run local-setup run: | git clone https://github.com/matter-labs/local-setup.git diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b301a09..93f76d3 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -22,16 +22,16 @@ jobs: go-version: 1.20 - name: Run gofmt run: | - echo "Checking code formatting..." - gofmt -d -e . - - name: Run golangci-lint - run: | - echo "Running linter..." - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - golangci-lint run ./... - - name: Fail if issues found - run: exit 1 - if: ${{ failure() || success() }} + fmt_output=$(gofmt -l .) + + if [ -n "$fmt_output" ]; then + echo "Code not formatted correctly:" + echo "$fmt_output" + exit 1 + else + echo "Code is formatted correctly" + exit 0 + fi commits: name: Check commits runs-on: ubuntu-latest