mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
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:
parent
cdb52015f4
commit
516bc475b6
3 changed files with 14 additions and 38 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue