-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
50 lines (41 loc) · 1.16 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
version: '3'
tasks:
default:
cmds:
- task: test
- task: build
lint:
cmds:
- gofmt -w .
- golangci-lint run
generate:
run: once
sources:
- pkg/graph/*.go
- pkg/gitlab/*.go
- pkg/rules/interpreter/*.go
- pkg/symbols/init.go
generates:
- pkg/symbols/*.go
cmds:
- go generate ./...
build:
cmds:
- task: generate
- CGO_ENABLED=0 go build -ldflags "-w" -v -o ./bin/gogl ./cmd/cli
docker:
cmds:
- docker buildx build --output "type=docker,push=false" --tag ghcr.io/watcherwhale/gogl:dev .
docker-publish:
cmds:
- docker buildx build --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x --tag ghcr.io/watcherwhale/gogl:dev --push .
test:
cmds:
- task: generate
- go test -v `go list ./... | grep -v github.com/watcherwhale/gogl-ci/internal/tests/testplans/v1alpha2/simple/plans` -coverprofile=coverage.out
- |
go tool cover -func coverage.out | tail -n 1 | awk '{ print "Total coverage: " $3 }'
install:
cmds:
- task: build
- cp ./bin/gogl ~/.local/bin/gogl