feat(ci/cd): add cache
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Dawid Wysokiński 2022-10-09 08:38:29 +02:00
parent 2f6255e2c5
commit f59b1ceec6
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892

View File

@ -25,6 +25,8 @@ steps:
image: golang:1.19
environment:
TESTS_DB_DSN: postgres://postgres:dcbot@database:5432/dcbot?sslmode=disable
GOMODCACHE: /drone/src/.cache/test/go-mod
GOCACHE: /drone/src/.cache/test/go-build
commands:
- make generate
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
@ -85,6 +87,9 @@ steps:
- .cache/gomod/go-build
- name: check go.mod
image: golang:1.19
environment:
GOMODCACHE: /drone/src/.cache/gomod/go-mod
GOCACHE: /drone/src/.cache/gomod/go-build
commands:
- make generate
- go mod tidy
@ -140,6 +145,10 @@ steps:
- .cache/lint/golangci-lint
- name: run golangci-lint
image: golangci/golangci-lint:v1.50
environment:
GOMODCACHE: /drone/src/.cache/lint/go-mod
GOCACHE: /drone/src/.cache/lint/go-build
GOLANGCI_LINT_CACHE: /drone/src/.cache/lint/golangci-lint
commands:
- make generate
- golangci-lint run