woodpecker/.woodpecker/test.yml
6543 0aefdc9978
Add tests framework for storage migration (#630)
* add test sqlite db

* migration tests for sqlite

* fix pipeline config

* fix tests to other dbms

* fix postgres & mysql
2021-12-20 16:15:21 +01:00

76 lines
1.6 KiB
YAML

pipeline:
dummy-web:
image: golang:1.16
commands:
- mkdir -p web/dist/
- echo "test" > web/dist/index.html
lint:
image: golang:1.16
group: test
commands:
- make lint
when:
path:
include:
- "vendor/**"
- "go.mod"
- "go.sum"
- "**/*.go"
- ".golangci.yml"
test:
image: golang:1.16
group: test
commands:
- make test-agent
- make test-server
- make test-cli
- make test-lib
when:
path:
include:
- "vendor/**"
- "go.mod"
- "go.sum"
- "**/*.go"
sqlite:
image: golang:1.16
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=sqlite3
commands:
- make test-server-datastore
postgres:
image: golang:1.16
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=postgres
- WOODPECKER_DATABASE_DATASOURCE=host=service-postgres user=postgres dbname=postgres sslmode=disable
commands:
- make test-server-datastore
mysql:
image: golang:1.16
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=mysql
- WOODPECKER_DATABASE_DATASOURCE=root@tcp(service-mysql:3306)/test?parseTime=true
commands:
- make test-server-datastore
services:
service-postgres:
image: postgres:9.6
ports: ["5432"]
environment:
- POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
service-mysql:
image: mysql:5.6.27
ports: ["3306"]
environment:
- MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes