Skip to content

Commit

Permalink
Add check job to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jojo43 committed Jun 6, 2020
1 parent 1c7f590 commit f923bc2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down

0 comments on commit f923bc2

Please sign in to comment.