From 134b491d1d2c71a87c8bf5367be48c423466b152 Mon Sep 17 00:00:00 2001 From: Yukio Siraichi Date: Wed, 22 Oct 2025 15:24:42 -0300 Subject: [PATCH] Build PyTorch and PyTorch/XLA on no code changes 'push' events. --- .github/workflows/build_and_test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8381ed2823ad..3ac529374e6c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -42,7 +42,14 @@ jobs: with: dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm timeout-minutes: 45 # Takes ~20m as of 2025/5/30. - has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }} + # We should build PyTorch and PyTorch/XLA if: + # 1. There are code changes. + # 2. This is a `push` event to `master` or release branches. + # + # The reason for (2) is that `push-docs` job below is run precisely on (2) condition. + # In order for it (the `push-docs` job) to be successful, it needs to install the PyTorch + # and PyTorch/XLA wheels. Therefore, we need to build their wheels by running this job. + has_code_changes: ${{ (needs.check_code_changes.outputs.has_code_changes == 'true' || github.event_name == 'push') && 'true' || 'false' }} runner: linux.24xlarge secrets: gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}