-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
87 lines (72 loc) · 2.57 KB
/
Copy pathTaskfile.yml
File metadata and controls
87 lines (72 loc) · 2.57 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
version: "3"
tasks:
default: task --list-all
# Continues Development ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
watcher:
desc: watcher
sources:
- ./**/*.go
method: timestamp
cmds:
- task: lints
- task: test-summary
- task: build-race
# Generating assets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generate:
desc: Generate Assets
sources:
- ./checkers_*.go
- ./cmd/internal/**/*.go
method: timestamp
cmds:
- task generate-mirror-table
- task generate-tests
generate-mirror-table:
desc: Generates Assets at testdata
cmd: go run ./cmd/internal/mirror-table/ > ./MIRROR_FUNCS.md
generate-tests:
desc: Generate Asset MIRROR_FUNCS.md
cmd: go run ./cmd/internal/tests/ ./testdata
# Run Tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests:
desc: Run Tests
cmd: |
go test -v -count=1 -race \
-failfast \
-parallel=2 \
-timeout=1m \
-covermode=atomic \
-coverpkg $(go list ./... | grep -v -E "cmd" | tr "\n" ",") \
-coverprofile=coverage.cov ./...
ignore_error: true
test-summary:
desc: Run Tests (Summary)
cmd: |
go test -v -count=1 -race \
-failfast \
-parallel=2 \
-timeout=1m \
-covermode=atomic \
-coverpkg $(go list ./... | grep -v -E "cmd" | tr "\n" ",") \
-coverprofile=coverage.cov --json ./... | tparse -all
ignore_error: true
testcase: go test -v -failfast -count=1 -run "TestAll/{{ .Case }}" ./...
# Build Artifacts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build:
desc: Build binary
cmd: go build -trimpath -ldflags="-w -s" -o bin/mirror ./cmd/mirror/
build-race:
desc: Build binary with race flag
cmd: go build -race -trimpath -ldflags="-w -s" -o bin/mirror ./cmd/mirror/
install:
desc: Install binary
cmd: go install -trimpath -v -ldflags="-w -s" ./cmd/mirror
# Linter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lints: golangci-lint run --no-config ./...
# Other
cover:
desc: Run Coverage
cmd: go tool cover -html=coverage.cov
test-release:
desc: Testing Release
cmd: goreleaser release --snapshot --clean