-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
76 lines (74 loc) · 2.38 KB
/
Taskfile.yaml
File metadata and controls
76 lines (74 loc) · 2.38 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
- go install gotest.tools/gotestsum@latest
- go install github.com/securego/gosec/v2/cmd/gosec@latest
setup:jwks:
desc: Setup local keys for JWKS
cmds:
- scripts/jwks.sh
get:
desc: go-get all packages
cmds:
- go get ./...
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:report
test:unit:
desc: Unit tests for the backend application.
cmds:
- mkdir -p tmp/
- gotestsum --format-icons hivis --format pkgname-and-test-fails --junitfile tmp/unit-tests.xml -- -coverprofile=tmp/cover.unit.out ./internal/...
test:acceptance:
desc: Acceptance tests for the backend application.
cmds:
- ginkgo ./test/acceptance...
test:integration:
desc: Integration tests for the backend application.
cmds:
- mkdir -p tmp/
- gotestsum --format-icons hivis --format pkgname-and-test-fails --junitfile tmp/integration-tests.xml -- -coverprofile=tmp/cover.integration.out ./test/integration/...
test:report:
desc: Generate test coverage report.
cmds:
- rm -rf tmp/test-results && mkdir -p tmp/test-results
- cp tmp/unit-tests.xml tmp/test-results
- cp tmp/integration-tests.xml tmp/test-results
lint:
desc: Lint go package (this repository package)
cmds:
- staticcheck ./...
- test -z "$(gofmt -d .)"
security:
desc: Run gosec (security checker) over the codebase
cmds:
- gosec -tests ./...
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}}