-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTaskfile.yml
More file actions
61 lines (52 loc) · 1.72 KB
/
Taskfile.yml
File metadata and controls
61 lines (52 loc) · 1.72 KB
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
version: "3"
vars:
HASH: { sh: git rev-parse --short HEAD }
BRANCH: { sh: git rev-parse --abbrev-ref HEAD }
BINARY_PATH: ./bin/main
tasks:
setup:
desc: Install development tools and configure git hooks
cmds:
- task: tools
tools:
env:
FILE: ".git/hooks/pre-commit"
cmds:
- go install -v github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- go install -v github.com/air-verse/air@latest
- go install -v github.com/golang/mock/mockgen@latest
- go install -v github.com/fatih/gomodifytags@latest
- go install -v github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- go install -v gotest.tools/gotestsum@latest
- go install -v github.com/segmentio/golines@latest
- cp .github/pre-commit.sh $FILE
- chmod +x $FILE
- test -f $FILE && echo "$FILE exists."
generate:
cmds:
- go generate ./...
analysis:
deps: [generate]
cmds:
- golangci-lint run --new-from-rev HEAD~ ./...
unit_tests:
deps: [generate]
cmds:
- gotestsum --format=testname --hide-summary=skipped -- -failfast -count=1 -v -race ./...
build:
deps: [generate]
cmds:
- go build -o bin/cronx && rm bin/cronx
- go build -o bin/simplest example/1-simplest/main.go && rm bin/simplest
- go build -o bin/storage example/2-storage/main.go && rm bin/storage
run-simplest:
deps: [build]
cmds:
- air -c ./scripts/.air-simplest.toml
run-storage:
deps: [build]
cmds:
- docker-compose down -v
- docker-compose up -d
- until docker exec postgres pg_isready -U unicorn_user -d magical_password; do echo "Waiting for database..."; sleep 2; done;
- air -c ./scripts/.air-storage.toml