Skip to content

Commit df6798d

Browse files
authored
Fix push-docs CI for push events without code changes. (#9689)
This PR fixes the error found in [this `push-docs` CI run][1] for a `push` event on `master` branch. **What happened:** - `push-docs` failed because it couldn't find the `torch-xla-wheels` artifact - The `torch-xla-wheels` artifact wasn't uploaded because its upload and the dependent build step are coditioned by `inputs.has_code_changes == 'true'` **Solution:** - Build PyTorch and PyTorch/XLA on every `push` event, since that's also when `push-docs` runs _Note: `push-docs` job actually needs to install both PyTorch and PyTorch/XLA, otherwise it can't retrieve the docstrings that we rely on to build the documentation._ [1]: https://github.com/pytorch/xla/actions/runs/18698514731/job/53322086395
1 parent 8ca9770 commit df6798d

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)