-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
69 lines (63 loc) · 1.7 KB
/
justfile
File metadata and controls
69 lines (63 loc) · 1.7 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
61
62
63
64
65
66
67
68
69
#!/usr/bin/env just --justfile
#
name := "go-set"
default:
@just --list --unsorted --justfile {{justfile()}} | grep -v default
# QA all code
qa:
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/source/log
source ./scripts/source/environment
log_info "Check go.mod and lint code"
which go
go mod tidy
go mod verify
log_info "Vetting"
go vet ./...
log_info "Formatting"
golangci-lint fmt ./...
log_info "Linting"
golangci-lint run ./...
log_info "Vulnerability checking"
go run golang.org/x/vuln/cmd/govulncheck@latest --show verbose ./...
# unittest all code
unittest:
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/source/log
source ./scripts/source/environment
log_info "Run unittests"
which go
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# benchmark all code
benchmark:
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/source/log
source ./scripts/source/environment
log_info "Run benchmarks"
which go
rm -f benchmark-new.txt
go test -run='^$' -count=10 -bench=. -benchmem ./... | tee benchmark-new.txt
go run golang.org/x/perf/cmd/benchstat@latest benchmark.txt benchmark-new.txt
# generate documentation server
doc:
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/source/log
source ./scripts/source/environment
log_info "Run documentation server at localhost:8080"
which go
go run golang.org/x/pkgsite/cmd/pkgsite@latest
# publish package to proxy
publish:
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/source/log
source ./scripts/source/environment
log_info "Publish"
which go
VERSION=$(git tag -l | sort -r -V | head -1)
GOPROXY=proxy.golang.org go list -m github.com/eccles/go-set@${VERSION}