-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yaml
94 lines (79 loc) · 2.12 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: "3"
includes:
config:
taskfile: ./configgen/Taskfile.yaml
docker:
taskfile: ./docker/Taskfile.yaml
dir: ./docker
aliases: [compose]
env:
GOFLAGS: -buildvcs=false
tasks:
default:
silent: true
cmds:
- task --list
## Go tasks
go:lint:
desc: runs golangci-lint, the most annoying opinionated linter ever
cmds:
- golangci-lint run --config=.golangci.yaml --verbose --fast --fix
go:fmt:
desc: format all go code
cmds:
- go fmt ./...
go:test:
desc: runs and outputs results of created go tests
aliases: [test]
cmds:
- go test -v ./...
go:test:cover:
desc: runs and outputs results of created go tests with coverage
aliases: [cover]
cmds:
- go test -v ./... -coverprofile=coverage.out
go:test:cover:out:
desc: runs and outputs results of created go tests with coverage
cmds:
- task: go:test:cover
- go tool cover -html=coverage.out
go:tidy:
desc: runs go mod tidy on the backend
aliases: [tidy]
cmds:
- go mod tidy
go:all:
aliases: [go]
desc: runs all go test and lint related tasks
cmds:
- task: go:tidy
- task: go:fmt
- task: go:lint
- task: go:test
go:build:
desc: Runs go build for the riverboat server
cmds:
- go build -mod=mod -o riverboat
go:build:ci:
desc: Runs go build for the riverboat server
cmds:
- go build -mod=mod -a -o bin/riverboat
run:
dotenv: ["{{.ENV}}/.env-dev"]
desc: runs the riverboat server in dev mode, assumes all other dependencies (postgres) are running
cmds:
- go run main.go serve --debug --pretty
run-dev:
dotenv: ["{{.ENV}}/.env-dev"]
desc: runs the riverboat server in dev mode with dependencies in docker
cmds:
- task: docker:postgres
- task: docker:ui:up
- 'open "http://localhost:8082"'
- task: run
precommit-full:
desc: Lint the project against all files
cmds:
- pre-commit install && pre-commit install-hooks
- pre-commit autoupdate
- pre-commit run --show-diff-on-failure --color=always --all-files