Skip to content

Commit 2439db1

Browse files
Teresa Chenboe20211
authored andcommitted
Skip build if only docs/icons changed (#908)
Signed-off-by: Teresa Chen <[email protected]>
1 parent 53db3b4 commit 2439db1

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.buildkite/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
x-run-condition: &run-on-nightly-or-tag
2+
if: build.env("NIGHTLY") == "1" || build.tag =~ /^v?[0-9]+(\.[a-zA-Z0-9]+)*([a-zA-Z]+[0-9]*)?$/
3+
14
steps:
25
- label: "Upload Tests for Models & Features"
3-
if: build.env("NIGHTLY") == "1" || build.tag =~ /^v?[0-9]+(\.[a-zA-Z0-9]+)*([a-zA-Z]+[0-9]*)?$/
6+
<<: *run-on-nightly-or-tag
47
agents:
58
# TODO : can be done on non-TPU queues once they're set up b/449203039
69
queue: tpu_v6e_queue
@@ -11,7 +14,7 @@ steps:
1114
continue_on_failure: true # ensure we still generate support matrices even if some tests fail
1215

1316
- label: "Generate support matrices"
14-
if: build.env("NIGHTLY") == "1" || build.tag =~ /^v?[0-9]+(\.[a-zA-Z0-9]+)*([a-zA-Z]+[0-9]*)?$/
17+
<<: *run-on-nightly-or-tag
1518
key: generate_support_matrices
1619
agents:
1720
queue: tpu_v6e_queue
@@ -39,7 +42,7 @@ steps:
3942
# - echo "committing verified commit hashes"
4043
#
4144
- label: "Commit support matrices if is nightly build"
42-
if: build.env("NIGHTLY") == "1" || build.tag =~ /^v?[0-9]+(\.[a-zA-Z0-9]+)*([a-zA-Z]+[0-9]*)?$/
45+
<<: *run-on-nightly-or-tag
4346
key: commit_nightly_support_matrices
4447
depends_on: generate_support_matrices
4548
agents:

.buildkite/scripts/bootstrap.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
#!/bin/bash
22

3+
# --- Skip build if only docs/icons changed ---
4+
echo "--- :git: Checking changed files"
5+
6+
# Get a list of all files changed in this commit
7+
FILES_CHANGED=$(git diff-tree --no-commit-id --name-only -r "$BUILDKITE_COMMIT")
8+
9+
echo "Files changed:"
10+
echo "$FILES_CHANGED"
11+
12+
# Filter out files we want to skip builds for.
13+
NON_SKIPPABLE_FILES=$(echo "$FILES_CHANGED" | grep -vE "(\.md$|\.ico$|\.png$|^README$|^docs\/)")
14+
15+
if [ -z "$NON_SKIPPABLE_FILES" ]; then
16+
echo "Only documentation or icon files changed. Skipping build."
17+
# No pipeline will be uploaded, and the build will complete.
18+
exit 0
19+
else
20+
echo "Code files changed. Proceeding with pipeline upload."
21+
fi
22+
323
upload_pipeline() {
424
buildkite-agent pipeline upload .buildkite/pipeline_jax.yml
525
# buildkite-agent pipeline upload .buildkite/pipeline_torch.yml

0 commit comments

Comments
 (0)