woodpecker/.woodpecker/test.yml

128 lines
2.6 KiB
YAML
Raw Normal View History

variables:
- &golang_image 'golang:1.18'
- &node_image 'node:16-alpine'
- &when_path
# related config files
- ".woodpecker/test.yml"
- ".golangci.yml"
# go source code
- "**/*.go"
- "go.*"
# schema changes
- "pipeline/schema/**"
pipeline:
2022-05-17 15:59:51 +00:00
lint-pipeline:
image: *golang_image
2022-05-17 15:59:51 +00:00
commands:
- go run github.com/woodpecker-ci/woodpecker/cmd/cli lint
when:
path:
- ".woodpecker/**"
2022-07-19 13:06:08 +00:00
- "pipeline/schema/**"
2022-05-17 15:59:51 +00:00
vendor:
image: *golang_image
group: prepare
commands:
- go mod vendor
when:
path: *when_path
dummy-web:
image: *golang_image
group: prepare
commands:
- mkdir -p web/dist/
- echo "test" > web/dist/index.html
when:
path: *when_path
lint:
image: *golang_image
group: test
commands:
- make lint
when:
path: *when_path
2022-06-17 10:03:34 +00:00
lint-editorconfig:
image: mstruebing/editorconfig-checker
group: test
2021-12-07 00:13:31 +00:00
test:
image: *golang_image
group: test
commands:
- make test-agent
- make test-server
- make test-cli
- make test-lib
when:
path: *when_path
sqlite:
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=sqlite3
commands:
- make test-server-datastore-coverage
when:
path: *when_path
postgres:
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=postgres
- WOODPECKER_DATABASE_DATASOURCE=host=service-postgres user=postgres dbname=postgres sslmode=disable
commands:
- make test-server-datastore
when:
path: *when_path
mysql:
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=mysql
- WOODPECKER_DATABASE_DATASOURCE=root@tcp(service-mysql:3306)/test?parseTime=true
commands:
- make test-server-datastore
when:
path: *when_path
codecov:
pull: true
image: woodpeckerci/plugin-codecov:next-alpine
settings:
files:
- agent-coverage.out
- cli-coverage.out
- server-coverage.out
- datastore-coverage.out
token:
from_secret: codecov_token
when:
path: *when_path
services:
2021-12-07 00:13:31 +00:00
service-postgres:
image: postgres:11
ports: ["5432"]
environment:
- POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
when:
path: *when_path
2021-12-07 00:13:31 +00:00
service-mysql:
image: mysql:5.6.27
ports: ["3306"]
environment:
- MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
when:
path: *when_path