Skip to content

Commit

Permalink
Speed up pipelines (#2127)
Browse files Browse the repository at this point in the history
- 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)

#1910
  • Loading branch information
qwerty287 authored Aug 7, 2023
1 parent cdb5201 commit 516bc47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 38 deletions.
15 changes: 5 additions & 10 deletions .woodpecker/docs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -33,7 +31,6 @@ steps:
- pnpm install --frozen-lockfile
- pnpm build
when:
- path: *when_path
- cron: update_docs
event: cron

Expand All @@ -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)

Expand Down Expand Up @@ -78,6 +74,5 @@ steps:
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
path: *when_path
- cron: update_docs
event: cron
6 changes: 1 addition & 5 deletions .woodpecker/test.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
31 changes: 8 additions & 23 deletions .woodpecker/web.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -28,7 +18,6 @@ steps:
commands:
- corepack enable
- pnpm install --frozen-lockfile
when: *when

lint:
group: test
Expand All @@ -37,7 +26,6 @@ steps:
commands:
- corepack enable
- pnpm lint
when: *when

formatcheck:
group: test
Expand All @@ -46,7 +34,6 @@ steps:
commands:
- corepack enable
- pnpm format:check
when: *when

typecheck:
group: test
Expand All @@ -55,7 +42,6 @@ steps:
commands:
- corepack enable
- pnpm typecheck
when: *when

test:
group: test
Expand All @@ -64,4 +50,3 @@ steps:
commands:
- corepack enable
- pnpm test
when: *when

0 comments on commit 516bc47

Please sign in to comment.