-
Notifications
You must be signed in to change notification settings - Fork 6
/
Taskfile.yaml
57 lines (55 loc) · 1.6 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
version: '3'
dotenv: ['.env']
tasks:
setup:
desc: Setup local environment for development.
cmds:
- go get github.com/mattn/goreman
- go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.15.2
- go install github.com/rakyll/gotest@latest
- go install honnef.co/go/tools/cmd/staticcheck@latest
get:
desc: go-get all packages
cmds:
- go get -d ./...
build:
desc: Build the go binary.
cmds:
- rm -rf cmd && mkdir -p cmd && CGO_ENABLED=0 go build -o cmd/ ./...
release:
desc: Build the application for release
cmds:
- task: setup
- task: get
- task: build
test:
desc: Run all tests and generate coverage
cmds:
- task: test:unit
- task: test:integration
- task: test:coverage
test:unit:
desc: Unit tests for the backend application.
cmds:
- gotest -race -coverprofile=coverage.unit.out -coverpkg=./internal/... ./internal/...
test:integration:
desc: Integration tests for the backend application.
cmds:
- ginkgo ./test/...
test:coverage:
desc: Generate test coverage report.
cmds:
- go tool cover -html=coverage.unit.out -o coverage.unit.html
lint:
desc: Lint go package (this repository package)
cmds:
- staticcheck ./...
run:
desc: Run the service component.
cmds:
- task: build
- cmd/space {{.CLI_ARGS}}
db:migration:create:
desc: "Create migration file (eg.: db:migration:create task -- NAME)."
cmds:
- migrate create -ext=".sql" -seq -digits=4 -dir="$PWD/configs/migrations" {{.CLI_ARGS}}