-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTaskfile.yaml
38 lines (33 loc) · 855 Bytes
/
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
---
version: '3'
env:
CGO_ENABLED: 0
tasks:
test:
summary: Run tests
cmds:
- task: test-deps-up
- task: test-run
- task: test-deps-down
test-deps-up:
summary: Starts test dependencies
cmds:
- cmd: docker compose up --detach --wait
test-deps-down:
summary: Stops test dependencies
cmds:
- cmd: docker compose down -v
test-run:
summary: Runs tests, must have dependencies running in the docker compose
cmds:
- cmd: go test -timeout 2m -cover -coverprofile=coverage.txt -covermode=atomic ./...
vars:
PG_PORT:
# `docker compose port postgres 5432` -> "0.0.0.0:52041"
sh: docker compose port postgres 5432 | cut -f2 -d":"
env:
PGHOST: localhost
PGPORT: "{{.PG_PORT}}"
PGUSER: test
PGPASSWORD: test
PGSSLMODE: disable