-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathTaskfile.yml
More file actions
103 lines (85 loc) · 1.97 KB
/
Copy pathTaskfile.yml
File metadata and controls
103 lines (85 loc) · 1.97 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# https://taskfile.dev
version: '3'
tasks:
# Building tasks
default:
desc: Test and build
cmds:
- task: test
- task: build
build:
desc: Build binary
cmds:
- go build .
build:lite:
desc: Build binary, stripping test features
cmds:
- go build -ldflags="-s -w" -tags=urfave_cli_no_docs,rare_no_pprof .
build:pcre2:
desc: Build PCRE binary
cmds:
- go build -tags=pcre2 .
build:pgo:
desc: Build the profile-guided-optimization file
sources: ["**/*.go"]
generates: [default.pgo]
cmds:
- rm default.pgo
- task: build
- ./rare --profile pgogen histo -m '(\d{3}) (\d+)' -e '{1}' -z testdata/*.gz
- defer: rm pgogen*.prof
- mv -f pgogen.cpu.prof default.pgo
- task: build
build:snapshot:
desc: Builds snapshots via goreleaser
cmds:
- goreleaser release --snapshot --clean
# Test
test:
desc: Run full coverage
cmds:
- task: test:race
- task: test:check
test:unit:
desc: Run all unit tests
cmds:
- go test ./...
- go test -tags=pcre2 github.com/zix99/rare/pkg/matchers/fastregex
test:race:
desc: Run tests with race
cmds:
- go test -race ./...
test:acceptance:
desc: Run acceptance tests
cmds:
- go test -timeout 30s -run ^TestRunAcceptance$ ./ -v
test:check:
desc: Run static checks
cmds:
- go vet $(go list ./... | grep -v /vendor/)
- go run honnef.co/go/tools/cmd/staticcheck@2024.1.1 ./...
# Docs
docs:
cmds:
- task: docs:mkdocs
- task: docs:cli
docs:mkdocs:
cmds:
- mkdocs build --strict
docs:serve:
cmds:
- mkdocs serve
docs:cli:
desc: Generate CLI docs to cli-help.md
cmds:
- go run . _gendoc > docs/cli-help.md
docs:vhs:
desc: Generate VHS gif for readme
cmds:
- vhs docs/images/rare.tape
# clean
clean:
ignore_error: true
cmds:
- rm rare rare.1.gz
- rm -r dist/