make ci work again #593

Merged
6543 merged 2 commits from 6543/go-sdk:make-ci-work-again into master 4 months ago
  1. 37
      Makefile
  2. 2
      gitea/go.mod
  3. 4
      gitea/go.sum

@ -67,23 +67,23 @@ vet:
cd gitea && $(GO) vet -vettool=gitea-vet $(PACKAGE)
.PHONY: ci-lint
ci-lint:
cd gitea/; \
$(GO) run github.com/mgechev/revive@latest -config ../.revive.toml .; \
ci-lint: tool-golangci tool-gofumpt tool-revive
@cd gitea/; echo -n "revive ..."; \
revive -config ../.revive.toml .; \
if [ $$? -eq 1 ]; then \
echo "Doesn't pass revive"; \
echo; echo "Doesn't pass revive"; \
exit 1; \
fi; \
diff=$$($(GO) run mvdan.cc/gofumpt@latest -extra -l .); \
fi; echo " done"; echo -n "gofumpt ...";\
diff=$$(gofumpt -extra -l .); \
if [ -n "$$diff" ]; then \
echo "Not gofumpt-ed"; \
echo; echo "Not gofumpt-ed"; \
exit 1; \
fi; \
$(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 run --timeout 5m; \
fi; echo " done"; echo -n "golangci-lint ...";\
golangci-lint run --timeout 5m; \
if [ $$? -eq 1 ]; then \
echo "Doesn't pass golangci-lint"; \
echo; echo "Doesn't pass golangci-lint"; \
exit 1; \
fi; \
fi; echo " done"; \
cd -; \
.PHONY: test
@ -121,3 +121,18 @@ bench:
.PHONY: build
build:
cd gitea && $(GO) build
tool-golangci:
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \
fi
tool-gofumpt:
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install mvdan.cc/gofumpt@latest; \
fi
tool-revive:
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install github.com/mgechev/revive@latest; \
fi

@ -3,6 +3,6 @@ module code.gitea.io/sdk/gitea
go 1.13
require (
github.com/hashicorp/go-version v1.4.0
github.com/hashicorp/go-version v1.5.0
github.com/stretchr/testify v1.7.0
)

@ -1,7 +1,7 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4=
github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.5.0 h1:O293SZ2Eg+AAYijkVK3jR786Am1bhDEh2GHT0tIVE5E=
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

Loading…
Cancel
Save