-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
54 lines (46 loc) · 1.58 KB
/
mise.toml
File metadata and controls
54 lines (46 loc) · 1.58 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
[env]
BUILD_DIR = "{{ cwd }}/build"
VERSION = "{{ exec(command='git describe --tags --always --dirty') }}"
COMMIT_HASH = "{{ exec(command='git rev-parse --short HEAD') }}"
[tools]
go = "1.24.11"
"aqua:golangci/golangci-lint" = "latest"
"aqua:securego/gosec" = "latest"
"go:github.com/go-critic/go-critic/cmd/gocritic" = "latest"
[tasks."setup"]
description = "Setup the project"
run = ["mise install", "go mod download", "go mod tidy"]
sources = ["go.mod", "mise.toml", "*/**/*.go"]
outputs = ["go.sum"]
[tasks."clean"]
description = "Clean the project"
run = ["rm -rf {{ env.BUILD_DIR }}", "mkdir -p {{ env.BUILD_DIR }}"]
[tasks."critic"]
description = "Run Go Critic against the project"
run = ["gocritic check -disable='#style' ./..."]
sources = ["*/**/*.go"]
[tasks."security"]
description = "Run Go Sec against the project"
run = ["gosec ./..."]
sources = ["*/**/*.go"]
[tasks."lint"]
description = "Run Go Lint against the project"
run = ["golangci-lint run --timeout=10m ./..."]
sources = ["*/**/*.go"]
[tasks."tests"]
description = "Run the tests"
depends = ["clean", "critic", "security", "lint"]
run = [
"go test -v -timeout 30s -coverprofile='{{ env.BUILD_DIR }}/cover.out' -coverpkg=./... -cover ./...",
"go tool cover -func='{{ env.BUILD_DIR }}/cover.out'",
]
sources = ["*/**/*.go"]
outputs = ["{{ env.BUILD_DIR }}/cover.out"]
[tasks."build"]
description = "Build the binary"
depends = ["tests"]
run = [
"CGO_ENABLED=0 go build -ldflags='-w -s -X main.version={{ env.VERSION }} -X main.commit={{ env.COMMIT_HASH }}' -o bin/bqrunner ./...",
]
sources = ["main.go"]
outputs = ["bin/bqrunner"]