-
Notifications
You must be signed in to change notification settings - Fork 9
/
Taskfile.dist.yml
61 lines (50 loc) · 1.62 KB
/
Taskfile.dist.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
# https://taskfile.dev
version: '3'
silent: true
env:
GOLANGCI_LINT_VERSION: latest
# BUILDKIT_PROGRESS: plain
vars:
GO_VERSION: bookworm
GO_CACHE_VOLUME_NAME: boilr-gocache
GO_MOD_CACHE_VOLUME_NAME: boilr-gomodcache
tasks:
go:shell:
desc: Shell into golang container
cmds:
- docker run --rm -it
--workdir /workspace
--volume {{.GO_CACHE_VOLUME_NAME}}:/root/.cache/go-build
--volume {{.GO_MOD_CACHE_VOLUME_NAME}}:/go/pkg/mod
--volume ${PWD}/.:/workspace
golang:{{.GO_VERSION}}
bash
go:deps:
desc: List direct dependencies with their current version and possible newer version
cmds:
- docker run --rm -it
--workdir /workspace
--volume {{.GO_CACHE_VOLUME_NAME}}:/root/.cache/go-build
--volume {{.GO_MOD_CACHE_VOLUME_NAME}}:/go/pkg/mod
--volume ${PWD}/.:/workspace
golang:{{.GO_VERSION}}
/bin/bash -c 'go list -f "{{`{{if not (or .Main .Indirect)}}{{.Path}}{{end}}`}}" -m all | xargs -r go list -m -u'
go:lint:
desc: Lint go code using Golangci-lint
cmds:
- docker run --rm
--workdir /workspace
--volume $(pwd):/workspace
golangci/golangci-lint:{{.GOLANGCI_LINT_VERSION}}
golangci-lint run
go:remove-cache-volumes:
desc: Remove Go cache volumes
cmds:
- docker volume rm {{.GO_CACHE_VOLUME_NAME}} || true
- docker volume rm {{.GO_MOD_CACHE_VOLUME_NAME}} || true
go:r:snapshot-build:
cmds:
- goreleaser build --clean --snapshot
go:r:snapshot-build:single:
cmds:
- goreleaser build --clean --snapshot --single-target