-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yaml
65 lines (55 loc) · 1.98 KB
/
taskfile.yaml
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
version: "3"
vars:
GOLANG_DAGGER: "github.com/purpleclay/daggerverse/golang"
tasks:
default:
desc: Runs all of the default tasks
cmds:
- task: ci
ci:
desc: Run all CI tasks
cmds:
- task: deps
- task: unit-test
- task: lint
deps:
desc: Install all dependencies
cmds:
- go mod tidy
test:
desc: Run all of the tests
cmds:
- task: unit-test
- task: docker-test
unit-test:
desc: Run the unit tests
vars:
TEST_FORMAT: '{{default "" .TEST_FORMAT}}'
COVER_PROFILE: '{{default "coverage.out" .COVER_PROFILE}}'
TEST_OPTIONS: '{{default "-short -race -vet=off -shuffle=on -p 1" .TEST_OPTIONS}}'
cmds:
- go test {{.TEST_OPTIONS}} -covermode=atomic -coverprofile={{.COVER_PROFILE}} {{.TEST_FORMAT}} ./...
docker-test:
desc: Run the docker-based tests
cmds:
- docker build . -t gitz-test:latest -f testdata/Dockerfile --build-arg test=tagsigned
- docker build . -t gitz-test:latest -f testdata/Dockerfile --build-arg test=tagsigningkey
- docker build . -t gitz-test:latest -f testdata/Dockerfile --build-arg test=commitsigned
- docker build . -t gitz-test:latest -f testdata/Dockerfile --build-arg test=commitsigningkey
- docker build . -t gitz-test:latest -f testdata/Dockerfile --build-arg test=showcommit
lint:
desc: Lint the code using golangci-lint
vars:
REPORT_FORMAT: '{{default "colored-line-number" .REPORT_FORMAT}}'
cmds:
- dagger call -m {{.GOLANG_DAGGER}} --src . lint --format {{.REPORT_FORMAT}}
format:
desc: Format the code using gofumpt
cmds:
- dagger call -m {{.GOLANG_DAGGER}} --src . format export --path .
docs:
desc: Builds and hosts the MkDocs documentation
vars:
MKDOCS_MATERIAL_VERSION: '{{default "9.5.26-insiders-4.53.11" .MKDOCS_MATERIAL_VERSION}}'
cmds:
- docker run --rm -it -p 8000:8000 -v $PWD:/docs ghcr.io/purpleclay/mkdocs-material-insiders:{{.MKDOCS_MATERIAL_VERSION}}