-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
44 lines (36 loc) · 999 Bytes
/
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
gofumpt := mvdan.cc/[email protected]
gosimports := github.com/rinchsan/gosimports/cmd/[email protected]
golangci_lint := github.com/golangci/golangci-lint/cmd/[email protected]
goreleaser := github.com/goreleaser/[email protected]
.PHONY: build
build:
@mkdir -p build
@go test -c . -o build/http-wasm-tck
.PHONY: test
test:
@go test -v ./e2e
.PHONY: lint
lint:
@CGO_ENABLED=0 go run $(golangci_lint) run --timeout 5m
.PHONY: format
format:
@go run $(gofumpt) -l -w .
@go run $(gosimports) -local github.com/http-wasm/ -w $(shell find . -name '*.go' -type f)
.PHONY: check
check: lint format
@go mod tidy
@if [ ! -z "`git status -s`" ]; then \
echo "The following differences will fail CI until committed:"; \
git diff --exit-code; \
fi
.PHONY: clean
clean: ## Ensure a clean build
@go clean -testcache
@rm -rf build
@rm -rf dist
.PHONY: snapshot
snapshot:
@go run $(goreleaser) build --snapshot --rm-dist
.PHONY: release
release:
@go run $(goreleaser) release --rm-dist