Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (44 loc) · 1.73 KB
/
Copy pathMakefile
File metadata and controls
60 lines (44 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
GO ?= go
GOFMT ?= gofmt
OAPI_CODEGEN_VERSION ?= v2.8.0
GOVULNCHECK_VERSION ?= v1.6.0
GO_LICENSES_VERSION ?= v2.0.1
GORELEASER ?= goreleaser
.PHONY: build test vet vuln fmt-check generate generate-check verify contract-check release-check e2e e2e-auth license-tool license-notices license-check
build:
$(GO) build -trimpath -o bin/convai ./cmd/convai
license-tool:
GOBIN="$(CURDIR)/.tools" $(GO) install github.com/google/go-licenses/v2@$(GO_LICENSES_VERSION)
license-notices: license-tool
$(GO) run ./tools/license-notices
license-check: license-tool
$(GO) run ./tools/license-notices --check
test:
$(GO) test -race ./...
e2e:
$(GO) test -count=1 -timeout=30m -v -run '^TestStaging' ./tests/e2e
e2e-auth:
CONVAI_E2E_REQUIRED=1 $(GO) test -count=1 -timeout=30m -v -run '^TestAuthReleaseStaging$$' ./tests/e2e
vet:
$(GO) vet ./...
vuln:
$(GO) run golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION) ./...
fmt-check:
@files="$$(find . -name '*.go' -not -path './.tools/*')"; \
test -z "$$($(GOFMT) -l $$files)"
generate:
$(GO) run ./tools/generate -config
$(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@$(OAPI_CODEGEN_VERSION) \
--config api/oapi-codegen.yaml .tools/character.codegen.json
$(GO) run ./tools/generate
generate-check:
$(MAKE) generate
git diff --exit-code -- api/oapi-codegen.yaml internal/characterapi/client.gen.go internal/api/dispatch.gen.go
contract-check:
$(GO) run ./tools/check-contract https://api2-stg.convai.com/openapi.json
verify: fmt-check vet test generate-check build
# Snapshot archives are local only: no tag, publication, or release credentials.
release-check:
$(GORELEASER) check
$(GORELEASER) release --snapshot --clean --skip=publish
$(GO) run ./tools/verify-release -dir dist