-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Taskfile.yaml
51 lines (44 loc) · 1.24 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
---
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_HOST:
sh: docker compose port postgres 5432
env:
TEST_POSTGRES: "postgres://test:test@{{.PG_HOST}}/test?sslmode=disable"
spell-lint:
summary: Check spelling
vars:
CURDIR:
sh: pwd
cmds:
- cmd: |
docker run \
--interactive --tty --rm \
--volume "{{.CURDIR}}:/workdir" \
--workdir "/workdir" \
python:3.12-slim bash -c "python -m pip install --upgrade pip && pip install 'codespell>=2.2.4' && codespell"
lint:
summary: Lint the code (expects golangci-lint to be installed)
cmds:
- cmd: golangci-lint run --config=./.github/linters/.golangci.yml --fix