Speed up pipelines (#2127)

- Use workflow-global conditions to also skip the `clone` step for
`docs` and `web` workflows
- never run `test` and `web` for pushes (they're running for PRs and
every change we do must pass checks on PRs, so they're unnecessary)

https://github.com/woodpecker-ci/woodpecker/issues/1910
This commit is contained in:
qwerty287 2023-08-07 10:58:42 +02:00 committed by GitHub
parent cdb52015f4
commit 516bc475b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 38 deletions

View file

@ -1,12 +1,7 @@
when:
event: [pull_request, push, cron]
branch: ${CI_REPO_DEFAULT_BRANCH}
variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
- &when_path
path:
- "docs/**"
- ".woodpecker/docs.yml"
# since we generate docs for cli tool we have to watch this too
@ -15,13 +10,16 @@ variables:
# api docs
- "server/api/**"
variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
steps:
build-cli:
image: *golang_image
commands:
- make docs
when:
- path: *when_path
- cron: update_docs
event: cron
@ -33,7 +31,6 @@ steps:
- pnpm install --frozen-lockfile
- pnpm build
when:
- path: *when_path
- cron: update_docs
event: cron
@ -50,7 +47,6 @@ steps:
failure: ignore
when:
event: pull_request
path: *when_path
# TODO: add step to remove preview again after PR is closed (waiting for #286)
@ -78,6 +74,5 @@ steps:
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- cron: update_docs
event: cron

View file

@ -1,9 +1,5 @@
when:
- event: [pull_request, tag]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- release/*
event: [pull_request, tag]
variables:
- &golang_image 'golang:1.20.2'

View file

@ -1,25 +1,15 @@
when:
- event: [pull_request, tag]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- release/*
event: [pull_request, tag]
path: &when_path
# related config files
- ".woodpecker/web.yml"
# web source code
- "web/**"
# api source code
- "server/api/**"
variables:
- &node_image 'node:18-alpine'
- &when
- path: &when_path
# related config files
- ".woodpecker/web.yml"
# web source code
- "web/**"
# api source code
- "server/api/**"
branch:
exclude: ${CI_REPO_DEFAULT_BRANCH}
event: push
- path: *when_path
event: [pull_request, tag, deployment]
steps:
deps:
@ -28,7 +18,6 @@ steps:
commands:
- corepack enable
- pnpm install --frozen-lockfile
when: *when
lint:
group: test
@ -37,7 +26,6 @@ steps:
commands:
- corepack enable
- pnpm lint
when: *when
formatcheck:
group: test
@ -46,7 +34,6 @@ steps:
commands:
- corepack enable
- pnpm format:check
when: *when
typecheck:
group: test
@ -55,7 +42,6 @@ steps:
commands:
- corepack enable
- pnpm typecheck
when: *when
test:
group: test
@ -64,4 +50,3 @@ steps:
commands:
- corepack enable
- pnpm test
when: *when