forked from protobom/protobom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
96 lines (79 loc) · 2.22 KB
/
Taskfile.yml
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
# --------------------------------------------------------------
# SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0
# --------------------------------------------------------------
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
includes:
fix:
taskfile: .taskfiles/fix.yml
install:
taskfile: .taskfiles/install.yml
vars:
RM: "{{.RM}}"
TOOLS_DIR: "{{.TOOLS_DIR}}"
lint:
taskfile: .taskfiles/lint.yml
vars:
TOOLS_DIR: "{{.TOOLS_DIR}}"
env:
GO111MODULE: "on"
GOPATH:
sh: go env GOPATH
GOPROXY: https://proxy.golang.org,direct
vars:
AGAINST: '{{default ".git" .AGAINST}}'
GIT_TAG:
sh: git describe --tags --abbrev=0
RM: '{{if eq OS "windows"}}powershell -Command "Remove-Item -Recurse -Force -Path"{{else}}rm -rf{{end}}'
TOOLS_DIR: '{{shellQuote (joinPath .ROOT_DIR ".bin")}}'
VERSION: "{{default .GIT_TAG .VERSION}}"
tasks:
default:
silent: true
cmd: task --list
clean:
desc: Clean the working directory
cmd: "{{.RM}} dist"
conformance:
desc: Regenerate the conformance golden samples. Only to be run when changes are expected
cmd: go run ./test/conformance/generator/ test/conformance/testdata/
fix:
desc: Apply fixes to Golang code and protocol buffer definitions where possible
cmds:
- task: fix:buf
- task: fix:go
install:
desc: Install dev tools
cmds:
- task: install:buf
- task: install:golangci-lint
lint:
desc: Lint Golang code and protocol buffer definitions
cmds:
- task: lint:buf
- task: lint:go
proto:
desc: Compile .proto files with Buf
cmds:
- task: lint:run
vars:
CLI_NAME: buf{{exeExt}}
CLI_ARGS: [generate]
- task: lint:run
vars:
CLI_NAME: go
CLI_ARGS: [generate, api/generate.go]
test:
desc: Run all tests
cmds:
- task: test:conformance
- task: test:unit
test:conformance:
desc: Run the conformance test suite
cmd: go test ./test/conformance
test:unit:
desc: Run unit tests
cmd: go test -failfast -v -coverprofile=coverage.out -covermode=atomic ./...