chore(repo): add local workflow targets
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
5020fbef42
commit
1ae029cfdb
3 changed files with 47 additions and 0 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -4,3 +4,9 @@
|
|||
# Knowledge base
|
||||
KB/
|
||||
.core/
|
||||
|
||||
# Local Go tooling caches
|
||||
.cache/
|
||||
.gocache/
|
||||
.gomodcache/
|
||||
.gopath/
|
||||
|
|
|
|||
30
Makefile
Normal file
30
Makefile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
.PHONY: build vet test cover tidy clean
|
||||
|
||||
override GOCACHE := $(CURDIR)/.cache/go-build
|
||||
override GOPATH := $(CURDIR)/.cache/go
|
||||
GO ?= go
|
||||
|
||||
GO_ENV = GOCACHE=$(GOCACHE) GOPATH=$(GOPATH)
|
||||
|
||||
build:
|
||||
@mkdir -p $(GOCACHE) $(GOPATH)
|
||||
@$(GO_ENV) $(GO) build ./...
|
||||
|
||||
vet:
|
||||
@mkdir -p $(GOCACHE) $(GOPATH)
|
||||
@$(GO_ENV) $(GO) vet ./...
|
||||
|
||||
test:
|
||||
@mkdir -p $(GOCACHE) $(GOPATH)
|
||||
@$(GO_ENV) $(GO) test ./... -count=1 -timeout 120s
|
||||
|
||||
cover:
|
||||
@mkdir -p $(GOCACHE) $(GOPATH)
|
||||
@$(GO_ENV) $(GO) test -cover ./...
|
||||
|
||||
tidy:
|
||||
@mkdir -p $(GOCACHE) $(GOPATH)
|
||||
@$(GO_ENV) $(GO) mod tidy
|
||||
|
||||
clean:
|
||||
@rm -rf $(CURDIR)/.cache $(CURDIR)/.gocache $(CURDIR)/.gomodcache $(CURDIR)/.gopath
|
||||
11
README.md
11
README.md
|
|
@ -45,6 +45,17 @@ go test -bench=. ./...
|
|||
go build ./...
|
||||
```
|
||||
|
||||
For repeatable local runs in a clean workspace, the repo also ships a
|
||||
`Makefile` with the standard workflow targets:
|
||||
|
||||
```bash
|
||||
make build
|
||||
make vet
|
||||
make test
|
||||
make cover
|
||||
make tidy
|
||||
```
|
||||
|
||||
## Licence
|
||||
|
||||
European Union Public Licence 1.2 — see [LICENCE](LICENCE) for details.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue