Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new multi when #1111

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 45 additions & 9 deletions .woodpecker/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,94 @@ pipeline:
- yarn install --frozen-lockfile
- yarn build
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

vendor:
group: prepare
image: *golang_image
commands:
- go mod vendor
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

build-server:
group: build
image: *golang_image
commands:
- make release-server
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

build-agent:
group: build
image: *golang_image
commands:
- make release-agent
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

build-cli:
group: build
image: *golang_image
commands:
- make release-cli
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

build-deb-rpm:
group: bundle
image: *golang_image
commands:
- make bundle
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

build-tarball:
group: bundle
image: *golang_image
commands:
- make release-tarball
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

checksums:
image: *golang_image
commands:
- make release-checksums
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}

Expand All @@ -89,7 +121,11 @@ pipeline:
- ls -la dist/*.*
- cat dist/checksums.txt
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

release:
image: plugins/github-release
Expand Down
8 changes: 8 additions & 0 deletions .woodpecker/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ pipeline:
- cd web/
- yarn install --frozen-lockfile
- yarn build
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
- event: [tag, pull_request]

cross-compile-server:
image: *xgo_image
Expand All @@ -34,6 +38,10 @@ pipeline:
PLATFORMS: linux|arm/v7;linux|arm64/v8;linux|amd64;linux|ppc64le
TAGS: bindata sqlite sqlite_unlock_notify
XGO_VERSION: *xgo_version
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
- event: [tag, pull_request]

publish-server-preview:
image: woodpeckerci/plugin-docker-buildx
Expand Down
20 changes: 8 additions & 12 deletions .woodpecker/helm.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variables:
- &when_path
- "charts/**"
- ".woodpecker/helm.yml"

pipeline:
set-version:
image: alpine/helm:3.5.3
Expand All @@ -11,21 +16,15 @@ pipeline:
- cat charts/woodpecker-agent/Chart.yaml
- cat charts/woodpecker-server/Chart.yaml
when:
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"
path: *when_path

lint:
image: alpine/helm:3.5.3
commands:
- helm lint charts/woodpecker-agent/
- helm lint charts/woodpecker-server/
when:
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"
path: *when_path

release:
image: quay.io/helmpack/chart-releaser:v1.4.0
Expand All @@ -43,7 +42,4 @@ pipeline:
- cd woodpecker-ci.github.io/ && cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch master --package-path ../.cr-release-packages --index-path ../.cr-index/index.yaml --charts-repo https://woodpecker-ci.org --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
when:
event: tag
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"
path: *when_path
113 changes: 98 additions & 15 deletions .woodpecker/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,26 @@ pipeline:
commands:
- go mod vendor
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

lint-pipeline:
image: *golang_image
commands:
- go run github.com/woodpecker-ci/woodpecker/cmd/cli lint
when:
path:
- ".woodpecker/**"
- "pipeline/schema/**"
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path:
- ".woodpecker/**"
- "pipeline/schema/**"
- event: [tag, pull_request]
path:
- ".woodpecker/**"
- "pipeline/schema/**"

dummy-web:
image: *golang_image
Expand All @@ -36,30 +46,79 @@ pipeline:
- mkdir -p web/dist/
- echo "test" > web/dist/index.html
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

lint:
image: *golang_image
group: test
commands:
- make lint
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

lint-editorconfig:
image: mstruebing/editorconfig-checker
group: test
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
- event: [tag, pull_request]

test:
test-agent:
image: *golang_image
group: test
commands:
- make test-agent
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

test-server:
image: *golang_image
group: test
commands:
- make test-server
- make test-cli
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

test-cli:
image: *golang_image
group: test
commands:
- make test-server
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

test-lib:
image: *golang_image
group: test
commands:
- make test-lib
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

sqlite:
image: *golang_image
Expand All @@ -69,7 +128,11 @@ pipeline:
commands:
- make test-server-datastore-coverage
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

postgres:
image: *golang_image
Expand All @@ -80,7 +143,11 @@ pipeline:
commands:
- make test-server-datastore
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

mysql:
image: *golang_image
Expand All @@ -91,7 +158,11 @@ pipeline:
commands:
- make test-server-datastore
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

codecov:
pull: true
Expand All @@ -105,7 +176,11 @@ pipeline:
token:
from_secret: codecov_token
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

services:
service-postgres:
Expand All @@ -115,7 +190,11 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path

service-mysql:
image: mysql:5.6.27
Expand All @@ -124,4 +203,8 @@ services:
- MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
when:
path: *when_path
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- event: [tag, pull_request]
path: *when_path
Loading