Skip to content

Commit 134b491

Browse files
committed
Build PyTorch and PyTorch/XLA on no code changes 'push' events.
1 parent 4e2515e commit 134b491

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/build_and_test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ jobs:
4242
with:
4343
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm
4444
timeout-minutes: 45 # Takes ~20m as of 2025/5/30.
45-
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
45+
# We should build PyTorch and PyTorch/XLA if:
46+
# 1. There are code changes.
47+
# 2. This is a `push` event to `master` or release branches.
48+
#
49+
# The reason for (2) is that `push-docs` job below is run precisely on (2) condition.
50+
# In order for it (the `push-docs` job) to be successful, it needs to install the PyTorch
51+
# and PyTorch/XLA wheels. Therefore, we need to build their wheels by running this job.
52+
has_code_changes: ${{ (needs.check_code_changes.outputs.has_code_changes == 'true' || github.event_name == 'push') && 'true' || 'false' }}
4653
runner: linux.24xlarge
4754
secrets:
4855
gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}

0 commit comments

Comments
 (0)