-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 1.3 KB
/
Makefile
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
GORELEASER_VERSION=v1.24.0
GORELEASER_DOWNLOAD_URL=https://github.com/goreleaser/goreleaser/releases/download/v1.24.0/goreleaser_$(shell uname)_$(shell uname -m).tar.gz
GORELEASER=./bin/goreleaser/goreleaser
GOLANGCI_LINT_VERSION=v1.60.1
LINTER=./bin/golangci-lint
LINTER_VERSION_FILE=./bin/.golangci-lint-version-$(GOLANGCI_LINT_VERSION)
EXECUTABLE=./sdk-test-harness
SOURCE_FILES=*.go $(shell find . -name '*.go')
TEST_DATA_FILES=$(shell find . -name '*.go') \
$(wildcard testdata/data-files/server-side-eval/*) \
$(wildcard testdata/data-files/client-side-eval/*)
.PHONY: build clean test lint build-release publish-release
build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCE_FILES) $(TEST_DATA_FILES)
go build
clean:
go clean
test:
go test -run=not-a-real-test ./... # just ensures that the tests compile
go test ./...
$(GORELEASER):
mkdir -p ./bin/goreleaser
curl -qL $(GORELEASER_DOWNLOAD_URL) | tar xvz -C ./bin/goreleaser
build-release: $(GORELEASER)
$(GORELEASER) --snapshot --skip-publish --skip-validate
publish-release: $(GORELEASER)
$(GORELEASER)
$(LINTER_VERSION_FILE):
rm -f $(LINTER)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin $(GOLANGCI_LINT_VERSION)
touch $(LINTER_VERSION_FILE)
lint: $(LINTER_VERSION_FILE)
$(LINTER) run ./...