Fix path schema (#723)

- allow array for path
- remove "include:" as it is default case
- run tests on schema changes too
This commit is contained in:
6543
2022-01-29 14:26:00 +01:00
committed by GitHub
parent 062579d66f
commit 95ce87fa1b
4 changed files with 98 additions and 92 deletions

View File

@@ -11,7 +11,6 @@ pipeline:
- yarn build - yarn build
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/binaries.yml" - ".woodpecker/binaries.yml"
- "nfpm/*.yml" - "nfpm/*.yml"
@@ -28,7 +27,6 @@ pipeline:
- make release-server - make release-server
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/binaries.yml" - ".woodpecker/binaries.yml"
- "nfpm/*.yml" - "nfpm/*.yml"
@@ -60,7 +58,6 @@ pipeline:
- make release-cli - make release-cli
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/binaries.yml" - ".woodpecker/binaries.yml"
- "nfpm/*.yml" - "nfpm/*.yml"
@@ -75,7 +72,6 @@ pipeline:
- make bundle - make bundle
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/binaries.yml" - ".woodpecker/binaries.yml"
- "nfpm/*.yml" - "nfpm/*.yml"
@@ -91,7 +87,6 @@ pipeline:
- make release-checksums - make release-checksums
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/binaries.yml" - ".woodpecker/binaries.yml"
- "nfpm/*.yml" - "nfpm/*.yml"

View File

@@ -6,12 +6,13 @@ pipeline:
- echo "test" > web/dist/index.html - echo "test" > web/dist/index.html
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
- "**/*.go" - "**/*.go"
- "go.*" - "go.*"
# schema changes
- "pipeline/schema/**"
lint: lint:
image: golang:1.16 image: golang:1.16
@@ -20,7 +21,6 @@ pipeline:
- make lint - make lint
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
- ".golangci.yml" - ".golangci.yml"
@@ -38,12 +38,13 @@ pipeline:
- make test-lib - make test-lib
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
- "**/*.go" - "**/*.go"
- "go.*" - "go.*"
# schema changes
- "pipeline/schema/**"
sqlite: sqlite:
image: golang:1.16 image: golang:1.16
@@ -54,7 +55,6 @@ pipeline:
- make test-server-datastore - make test-server-datastore
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
@@ -71,7 +71,6 @@ pipeline:
- make test-server-datastore - make test-server-datastore
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
@@ -88,7 +87,6 @@ pipeline:
- make test-server-datastore - make test-server-datastore
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
@@ -104,7 +102,6 @@ services:
- POSTGRES_HOST_AUTH_METHOD=trust - POSTGRES_HOST_AUTH_METHOD=trust
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code
@@ -119,7 +116,6 @@ services:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_ALLOW_EMPTY_PASSWORD=yes
when: when:
path: path:
include:
# related config files # related config files
- ".woodpecker/test.yml" - ".woodpecker/test.yml"
# go source code # go source code

View File

@@ -79,6 +79,15 @@ pipeline:
when: when:
path: "folder/**" path: "folder/**"
when-path-array:
image: alpine
commands:
- echo "test"
when:
path:
- "folder/**"
- "**/*.c"
when-path-include-exclude: when-path-include-exclude:
image: alpine image: alpine
commands: commands:

View File

@@ -260,6 +260,12 @@
"description": "Execute a step only on commit with certain files added/removed/modified. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#environment", "description": "Execute a step only on commit with certain files added/removed/modified. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#environment",
"oneOf": [ "oneOf": [
{ "type": "string" }, { "type": "string" },
{
"type" :"array",
"items": {
"type": "string"
}
},
{ {
"type": "object", "type": "object",
"properties": { "properties": {