Repository navigation
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
60 lines (51 loc) · 1.61 KB
/
Copy pathTaskfile.yaml
File metadata and controls
60 lines (51 loc) · 1.61 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
version: 3
silent: false
tasks:
clean:
cmds:
- "rm -f unit-test-report.md"
- "go clean -cache -testcache"
vendor:
cmds:
- "go mod vendor"
lint:
cmds:
- "go fmt -x ./..."
lint:check:
cmds:
- "R=$(go fmt ./...) && if [[ -n \"$R\" ]]; then echo \"The following files require formatting:\"; echo \"$R\"; exit 1; fi"
build:
cmds:
- "go build -v ./..."
test:
cmds:
- task: "test:unit"
test:unit:
cmds:
# Using go-testreport v0.3.2
- "go install github.com/becheran/go-testreport@90efc1ce13c872f23d6bc8a069527c26288b8f9c"
- "go test -race -cover -json ./... | go-testreport -output unit-test-report.md -vars 'Title:Unit Test Report'"
test:coverage:
cmds:
- "go install github.com/vladopajic/go-test-coverage/v2@7003e902e787e60375e1ce3ae5b85b19313dbff2"
- "go test -race -cover -json . -coverprofile=./cover.out -covermode=atomic -coverpkg=./..."
- "go-test-coverage --config=./.testcoverage.yml"
install:go:
deps:
- "install:go:linux"
install:go:linux:
internal: true
status:
- "command -v go"
platforms:
- "linux/amd64"
- "linux/arm64"
cmds:
- "curl -sSLO https://go.dev/dl/go{{.GO_VERSION}}.{{OS}}-{{ARCH}}.tar.gz"
- "sudo mkdir -p /usr/local/go"
- "sudo tar -C /usr/local -xzf go{{.GO_VERSION}}.{{OS}}-{{ARCH}}.tar.gz"
- "rm -f go{{.GO_VERSION}}.{{OS}}-{{ARCH}}.tar.gz"
- "echo 'PATH=\"${PATH}:/usr/local/go/bin\"' | sudo tee /etc/profile.d/go.sh >/dev/null 2>&1"
- "source /etc/profile.d/go.sh"
generates:
- "/usr/local/go/**"