From f923bc2f99a6b86ea63ceddec26e6874e0e43e73 Mon Sep 17 00:00:00 2001 From: jojo43 Date: Sat, 6 Jun 2020 21:32:25 +0900 Subject: [PATCH] Add check job to CI --- .github/workflows/ci.yml | 21 ++++++++++++++++++--- Makefile | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70189586c..8ca75542c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,24 @@ jobs: version: latest args: build --snapshot --skip-post-hooks + check: + runs-on: ubuntu-18.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v1 + with: # Ideally this should be picked up from .go-version rather than hard-coded + go-version: 1.14.1 + - + name: Run fmt check + run: make fmtcheck + test: runs-on: ${{ matrix.os }} strategy: @@ -53,9 +71,6 @@ jobs: - name: Go mod verify run: go mod verify - - - name: Run fmt check - run: make fmtcheck - name: Run tests run: make test diff --git a/Makefile b/Makefile index 5870e2452..cefede3aa 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ fmt: @gofmt -s -w $(SOURCE_FILES) fmtcheck: - @gofmt -s -l $(SOURCE_FILES) | grep ".*\.go"; if [ $$? -eq 0 ]; then exit 1; fi + @gofmt -s -l $(SOURCE_FILES) | grep ^; if [ $$? -eq 0 ]; then exit 1; fi test: go test -mod=vendor ./...