Skip to content

Commit

Permalink
add ci-generate check (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
peakle committed Jan 24, 2022
1 parent 319a0d4 commit 8d39095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/go.yml
Expand Up @@ -20,6 +20,10 @@ jobs:
run: |
make ci-linter
- name: Precompiled
run: |
make ci-generate
- name: Test
run: |
make ci-tests
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -24,7 +24,7 @@ docs:
cd ./cmd/makedocs && go run main.go

ci:
@if [ "$(TEST_SUITE)" = "linter" ]; then make ci-linter; else make ci-tidy; make ci-tests; fi
@if [ "$(TEST_SUITE)" = "linter" ]; then make ci-linter; else make ci-tidy; make ci-generate; make ci-tests; fi

ci-tidy:
go mod tidy
Expand All @@ -35,6 +35,10 @@ ci-tidy:
ci-tests:
GOCRITIC_EXTERNAL_TESTS=1 go test -v -race -count=1 -coverprofile=coverage.out ./...

ci-generate:
go generate ./...
git diff --exit-code --quiet || (echo "Please run 'go generate ./...' to update precompiled rules."; false)

ci-linter:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH_DIR)/bin v1.30.0
@$(GOPATH_DIR)/bin/golangci-lint run -v
Expand Down

0 comments on commit 8d39095

Please sign in to comment.