dcbot/.woodpecker/test.yml
Dawid Wysokiński 24da0ad533
Some checks failed
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/tag/docker Pipeline failed
ci/woodpecker/tag/deploy unknown status
feat: migrate from drone to woodpecker (#125)
Reviewed-on: #125
2023-09-09 05:43:58 +00:00

50 lines
946 B
YAML

when:
- event: [pull_request]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
variables:
- &go_image 'golang:1.21'
services:
database:
image: postgres:14.8
environment:
POSTGRES_DB: dcbot
POSTGRES_PASSWORD: dcbot
redis:
image: redis:7.0.12
steps:
generate:
image: *go_image
pull: true
commands:
- make generate
test:
image: *go_image
group: test
pull: true
environment:
TESTS_DB_DSN: postgres://postgres:dcbot@database:5432/dcbot?sslmode=disable
TESTS_REDIS_CONNECTION_STRING: redis://:@redis:6379/0
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
lint:
image: golangci/golangci-lint:v1.54
pull: true
group: test
commands:
- golangci-lint run
check-go-mod:
image: *go_image
group: test
pull: true
commands:
- go mod tidy
- git diff --exit-code go.mod