-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
72 lines (61 loc) · 1.74 KB
/
Taskfile.yml
File metadata and controls
72 lines (61 loc) · 1.74 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
# https://taskfile.dev/
version: '3'
env:
OPSLEVEL_GO_PKG: "github.com/opslevel/opslevel-go/v2025"
SRC_DIR: "{{.TASKFILE_DIR}}/src"
tasks:
ci:
desc: Workflow to run in CI
cmds:
- task: lint
- task: test
lint:
desc: Formatting and linting
dir: "{{.SRC_DIR}}"
cmds:
- test -z "$(go tool gofumpt -d -e . | tee /dev/stderr)"
- go vet ./...
- go tool golangci-lint run
fix:
desc: Fix formatting, linting, go.mod, and update submodule
dir: "{{.SRC_DIR}}"
cmds:
- task: update-opslevel-go
- go tool gofumpt -w .
- go mod tidy
- go tool golangci-lint run --fix
setup:
desc: Setup linter, formatter, etc. for local testing and CI
cmds:
- task: workspace
test:
desc: Run tests
dir: "{{.SRC_DIR}}"
cmds:
- go test -race -coverprofile=coverage.txt -covermode=atomic -v ./common/... {{ .CLI_ARGS }}
test-integration:
desc: Run Integration tests
dir: "{{.SRC_DIR}}"
cmds:
- go test -race -coverprofile=coverage.txt -covermode=atomic -v ./cmd/... {{ .CLI_ARGS }}
test-e2e:
desc: Run end to end Integration tests
dir: "{{.SRC_DIR}}"
cmds:
- go test -v ./e2e/... {{ .CLI_ARGS }}
update-opslevel-go:
desc: Update opslevel-go version to latest release
dir: "{{.SRC_DIR}}"
cmds:
- go get -u "{{.OPSLEVEL_GO_PKG}}"
workspace:
desc: Setup local workspace for cli & opslevel-go development
dir: "{{.SRC_DIR}}"
cmds:
- cmd: echo "Setting up opslevel-go workspace..."
silent: true
- git -C .. submodule update --init --recursive
- go work init || true
- go work use . submodules/opslevel-go
- cmd: echo "opslevel-go workspace ready!"
silent: true