-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
55 lines (52 loc) · 1.5 KB
/
Taskfile.yml
File metadata and controls
55 lines (52 loc) · 1.5 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
# yaml-language-server: $schema=https://json.schemastore.org/taskfile.json
version: '3'
env:
COVERAGE_FOLDER: coverage
tasks:
lint:
desc: Use golangci-lint (.golangci.yml).
cmds:
- golangci-lint run --fix $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values("./" + . + "/...")[]')
test:
desc: Run test.
cmds:
- go test $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values("./" + . + "/...")[]')
coverage:
desc: Makes report coverage.
cmds:
- go test $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values("./" + . + "/...")[]') -covermode=count -coverprofile=coverage.out
- go tool cover -html coverage.out -o coverage.html
- go tool cover -func=coverage.out -o=coverage.out
download:
desc: Run go mod tidy.
cmds:
- go work sync
- for f in $(find . -name go.mod); do (cd $(dirname $f); go mod tidy) ; done
upgrade:
desc: Check for latest direct dependencies.
cmds:
- go-mod-upgrade
build:
desc: Build the go binary.
generates:
- app
interactive: true
cmds:
- go build -v $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values("./" + . + "/...")[]')
all:
desc: Run relevant tasks.
cmds:
- task: download
- task: lint
- task: test
- task: coverage
- task: build
default:
desc: Run [build] task.
cmds:
- task: build
run:
desc: Run main.go.
cmds:
- echo '{{OS}}'
- ./$OUTPUT_FOLDER/$EXECUTABLE