-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Run only docs workflow #2203
Run only docs workflow #2203
Changes from 12 commits
fa38934
9c89e3e
253186b
ce70770
7c0662e
0d8c753
2a414b4
1822574
7bc4813
cf41ab2
2336ae2
8081459
7080179
2917929
a3daa85
5e55e0f
d3f3a50
85b4182
abf315a
43d23b0
892f4ec
0b11754
ca5b08d
b5db54e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,23 @@ variables: | |
- &platforms_server 'linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64' | ||
- &platforms_preview 'linux/amd64' | ||
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le' | ||
- &when | ||
- path: &when_path | ||
# related config files | ||
- ".woodpecker/docker.yml" | ||
# go source code | ||
- 'agent/**' | ||
- 'cli/**' | ||
- 'cmd/**' | ||
- 'docker/**' | ||
- 'server/**' | ||
- 'shared/**' | ||
- 'web/**' | ||
- 'woodpecker-go/**' | ||
pat-s marked this conversation as resolved.
Show resolved
Hide resolved
|
||
event: [pull_request, tag, deployment] | ||
|
||
# vars used on push / tag events only | ||
- publish_logins: &publish_logins | ||
# Default DockerHub login | ||
- publish_logins: &publish_logins # Default DockerHub login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. publish_logins is not default dockerhub login ... the next entry is |
||
- registry: https://index.docker.io/v1/ | ||
username: | ||
from_secret: docker_username | ||
|
@@ -43,6 +56,8 @@ steps: | |
pull: true | ||
commands: | ||
- go mod vendor | ||
when: | ||
path: *when_path | ||
|
||
############### | ||
# S e r v e r # | ||
|
@@ -54,6 +69,8 @@ steps: | |
- corepack enable | ||
- pnpm install --frozen-lockfile | ||
- pnpm build | ||
when: | ||
path: *when_path | ||
|
||
cross-compile-server-preview: | ||
image: *xgo_image | ||
|
@@ -68,10 +85,11 @@ steps: | |
XGO_VERSION: *xgo_version | ||
when: | ||
event: pull_request | ||
path: *when_path | ||
|
||
publish-server-preview: | ||
image: woodpeckerci/plugin-docker-buildx | ||
secrets: [ docker_username, docker_password ] | ||
secrets: [docker_username, docker_password] | ||
group: docker | ||
settings: | ||
repo: woodpeckerci/woodpecker-server | ||
|
@@ -80,10 +98,11 @@ steps: | |
tag: pull_${CI_COMMIT_PULL_REQUEST} | ||
when: | ||
event: pull_request | ||
path: *when_path | ||
|
||
publish-server-alpine-preview: | ||
image: woodpeckerci/plugin-docker-buildx | ||
secrets: [ docker_username, docker_password ] | ||
secrets: [docker_username, docker_password] | ||
group: docker | ||
settings: | ||
repo: woodpeckerci/woodpecker-server | ||
|
@@ -92,6 +111,7 @@ steps: | |
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine | ||
when: | ||
event: pull_request | ||
path: *when_path | ||
|
||
cross-compile-server: | ||
image: *xgo_image | ||
|
@@ -117,7 +137,7 @@ steps: | |
repo: *publish_repos_server | ||
dockerfile: docker/Dockerfile.server.multiarch | ||
platforms: *platforms_server | ||
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] | ||
tag: [next, 'next-${CI_COMMIT_SHA:0:10}'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -130,7 +150,7 @@ steps: | |
repo: *publish_repos_server | ||
dockerfile: docker/Dockerfile.server.alpine.multiarch | ||
platforms: *platforms_alpine | ||
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] | ||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -170,7 +190,7 @@ steps: | |
dockerfile: docker/Dockerfile.server.multiarch | ||
platforms: *platforms_server | ||
# remove 'latest' on older version branches to avoid accidental downgrade | ||
tag: [latest, "${CI_COMMIT_TAG}"] | ||
tag: [latest, '${CI_COMMIT_TAG}'] | ||
logins: *publish_logins | ||
when: | ||
event: tag | ||
|
@@ -183,7 +203,7 @@ steps: | |
dockerfile: docker/Dockerfile.server.alpine.multiarch | ||
platforms: *platforms_alpine | ||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade | ||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] | ||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
event: tag | ||
|
@@ -195,14 +215,15 @@ steps: | |
publish-agent-preview: | ||
group: docker | ||
image: woodpeckerci/plugin-docker-buildx | ||
secrets: [ docker_username, docker_password ] | ||
secrets: [docker_username, docker_password] | ||
settings: | ||
repo: woodpeckerci/woodpecker-agent | ||
dockerfile: docker/Dockerfile.agent.multiarch | ||
platforms: *platforms_preview | ||
tag: pull_${CI_COMMIT_PULL_REQUEST} | ||
when: | ||
event: pull_request | ||
path: *when_path | ||
|
||
publish-next-agent: | ||
group: docker | ||
|
@@ -211,7 +232,7 @@ steps: | |
repo: *publish_repos_agent | ||
dockerfile: docker/Dockerfile.agent.multiarch | ||
platforms: *platforms_release | ||
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] | ||
tag: [next, 'next-${CI_COMMIT_SHA:0:10}'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -224,7 +245,7 @@ steps: | |
repo: *publish_repos_agent | ||
dockerfile: docker/Dockerfile.agent.alpine.multiarch | ||
platforms: *platforms_alpine | ||
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] | ||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -264,7 +285,7 @@ steps: | |
dockerfile: docker/Dockerfile.agent.multiarch | ||
platforms: *platforms_release | ||
# remove 'latest' on older version branches to avoid accidental downgrade | ||
tag: [latest, "${CI_COMMIT_TAG}"] | ||
tag: [latest, '${CI_COMMIT_TAG}'] | ||
logins: *publish_logins | ||
when: | ||
event: tag | ||
|
@@ -277,7 +298,7 @@ steps: | |
dockerfile: docker/Dockerfile.agent.alpine.multiarch | ||
platforms: *platforms_alpine | ||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade | ||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] | ||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
event: tag | ||
|
@@ -289,14 +310,15 @@ steps: | |
publish-cli-preview: | ||
group: docker | ||
image: woodpeckerci/plugin-docker-buildx | ||
secrets: [ docker_username, docker_password ] | ||
secrets: [docker_username, docker_password] | ||
settings: | ||
repo: woodpeckerci/woodpecker-cli | ||
dockerfile: docker/Dockerfile.cli.multiarch | ||
platforms: *platforms_preview | ||
tag: pull_${CI_COMMIT_PULL_REQUEST} | ||
when: | ||
event: pull_request | ||
path: *when_path | ||
|
||
publish-next-cli: | ||
group: docker | ||
|
@@ -305,7 +327,7 @@ steps: | |
repo: *publish_repos_cli | ||
dockerfile: docker/Dockerfile.cli.multiarch | ||
platforms: *platforms_release | ||
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] | ||
tag: [next, 'next-${CI_COMMIT_SHA:0:10}'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -318,7 +340,7 @@ steps: | |
repo: *publish_repos_cli | ||
dockerfile: docker/Dockerfile.cli.alpine.multiarch | ||
platforms: *platforms_alpine | ||
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] | ||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
branch: ${CI_REPO_DEFAULT_BRANCH} | ||
|
@@ -358,7 +380,7 @@ steps: | |
dockerfile: docker/Dockerfile.cli.multiarch | ||
platforms: *platforms_release | ||
# remove 'latest' on older version branches to avoid accidental downgrade | ||
tag: [latest, "${CI_COMMIT_TAG}"] | ||
tag: [latest, '${CI_COMMIT_TAG}'] | ||
logins: *publish_logins | ||
when: | ||
event: tag | ||
|
@@ -371,7 +393,7 @@ steps: | |
dockerfile: docker/Dockerfile.cli.alpine.multiarch | ||
platforms: *platforms_alpine | ||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade | ||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] | ||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine'] | ||
logins: *publish_logins | ||
when: | ||
event: tag |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,8 @@ steps: | |
group: prepare | ||
commands: | ||
- go mod vendor | ||
when: *when | ||
when: | ||
path: *when_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I am confused with the different use of |
||
|
||
lint-pipeline: | ||
image: *golang_image | ||
|
@@ -34,7 +35,6 @@ steps: | |
when: | ||
- <<: *when | ||
- path: | ||
- ".woodpecker/**" | ||
qwerty287 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- "pipeline/schema/**" | ||
|
||
dummy-web: | ||
|
@@ -43,14 +43,16 @@ steps: | |
commands: | ||
- mkdir -p web/dist/ | ||
- echo "test" > web/dist/index.html | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
lint: | ||
image: *golang_image | ||
group: test | ||
commands: | ||
- make lint | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
check_swagger: | ||
image: *golang_image | ||
|
@@ -59,18 +61,22 @@ steps: | |
- "make generate-swagger" | ||
- "DIFF=$(git diff | head)" | ||
- "[ -n \"$DIFF\" ] && { echo \"swagger not up to date, exec 'make generate-swagger' and commit\"; exit 1; } || true" | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
lint-editorconfig: | ||
image: mstruebing/editorconfig-checker | ||
group: test | ||
when: | ||
path: *when_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added it to a few more instances. Probably even more refinement possible across all pipelines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm it's actually missing for everything because you changed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll fix it throughout the day. Overall I think it's important to reduce/avoid unneeded runs to save resources and time - even if it is a bit of tedious small-scale optimization work. |
||
|
||
lint-license-header: | ||
image: *golang_image | ||
commands: | ||
- go install github.com/google/addlicense@latest | ||
- "addlicense -check -ignore \"vendor/**\" **/*.go" | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
test: | ||
image: *golang_image | ||
|
@@ -80,7 +86,8 @@ steps: | |
- make test-server | ||
- make test-cli | ||
- make test-lib | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
sqlite: | ||
image: *golang_image | ||
|
@@ -89,7 +96,8 @@ steps: | |
- WOODPECKER_DATABASE_DRIVER=sqlite3 | ||
commands: | ||
- make test-server-datastore-coverage | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
postgres: | ||
image: *golang_image | ||
|
@@ -99,7 +107,8 @@ steps: | |
- WOODPECKER_DATABASE_DATASOURCE=host=service-postgres user=postgres dbname=postgres sslmode=disable | ||
commands: | ||
- make test-server-datastore | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
mysql: | ||
image: *golang_image | ||
|
@@ -109,7 +118,8 @@ steps: | |
- WOODPECKER_DATABASE_DATASOURCE=root@tcp(service-mysql:3306)/test?parseTime=true | ||
commands: | ||
- make test-server-datastore | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
codecov: | ||
pull: true | ||
|
@@ -123,7 +133,8 @@ steps: | |
- datastore-coverage.out | ||
token: | ||
from_secret: codecov_token | ||
when: *when | ||
when: | ||
path: *when_path | ||
failure: ignore | ||
|
||
services: | ||
|
@@ -133,12 +144,14 @@ services: | |
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_HOST_AUTH_METHOD=trust | ||
when: *when | ||
when: | ||
path: *when_path | ||
|
||
service-mysql: | ||
image: mysql:5.6.27 | ||
ports: ["3306"] | ||
environment: | ||
- MYSQL_DATABASE=test | ||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes | ||
when: *when | ||
when: | ||
path: *when_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is unused, so we only need
path
as variable.