1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-03-03 15:22:25 +02:00
6543 062579d66f
Run pipeline for binary files on pull if go code changed (#722)
* run pipeline for binary files on pull if go code changed

* add release-dryrun

* run "test" only if go code changes

* fix-build-checksum
2022-01-29 13:58:55 +01:00

128 lines
2.7 KiB
YAML

pipeline:
dummy-web:
image: golang:1.16
commands:
- mkdir -p web/dist/
- echo "test" > web/dist/index.html
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
lint:
image: golang:1.16
group: test
commands:
- make lint
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
- ".golangci.yml"
# go source code
- "**/*.go"
- "go.*"
test:
image: golang:1.16
group: test
commands:
- make test-agent
- make test-server
- make test-cli
- make test-lib
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
sqlite:
image: golang:1.16
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=sqlite3
commands:
- make test-server-datastore
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
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
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
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
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
services:
service-postgres:
image: postgres:11
ports: ["5432"]
environment:
- POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"
service-mysql:
image: mysql:5.6.27
ports: ["3306"]
environment:
- MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
when:
path:
include:
# related config files
- ".woodpecker/test.yml"
# go source code
- "**/*.go"
- "go.*"