[ci] Conditional storybook builds (#136219) (#137889)

* [ci] Conditional storybook builds

This moves storybook builds to run conditionally, either if there's a
storybook change or the `ci:build-storybooks` label is set.

These builds don't seem to be providing test coverage, and may not be utilized
in scenarios such as automated backports or unrelated changes.

* test regex

* formatting

* Revert "test regex"

This reverts commit dcef465414.

* fix revert

* move to spot instance

* fix merge

(cherry picked from commit 22b21645bb)

Co-authored-by: Jonathan Budzenski <jon@elastic.co>
This commit is contained in:
Kibana Machine 2022-08-02 13:35:42 -04:00 committed by GitHub
parent d5cab415df
commit 00e0f7740c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View file

@ -62,13 +62,6 @@ steps:
queue: c2-8
timeout_in_minutes: 60
- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
label: 'Build Storybooks'
agents:
queue: c2-4
key: storybooks
timeout_in_minutes: 60
- command: .buildkite/scripts/steps/build_api_docs.sh
label: 'Build API Docs'
agents:

View file

@ -0,0 +1,7 @@
steps:
- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
label: 'Build Storybooks'
agents:
queue: n2-4-spot
key: storybooks
timeout_in_minutes: 60

View file

@ -118,6 +118,13 @@ const uploadPipeline = (pipelineContent: string | object) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/deploy_cloud.yml'));
}
if (
(await doAnyChangesMatch([/.*stor(ies|y).*/])) ||
GITHUB_PR_LABELS.includes('ci:build-storybooks')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/storybooks.yml'));
}
if (GITHUB_PR_LABELS.includes('ci:build-webpack-bundle-analyzer')) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/webpack_bundle_analyzer.yml'));
}