Skip to content

Accept conda channels' ToS with environment variable. #13825

Accept conda channels' ToS with environment variable.

Accept conda channels' ToS with environment variable. #13825

name: Build and test
on:
pull_request:
branches:
- master
- r[0-9]+.[0-9]+
- r[0-9]+.[0-9]+.[0-9]+
push:
branches:
- master
- r[0-9]+.[0-9]+
- r[0-9]+.[0-9]+.[0-9]+
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
jobs:
check_code_changes:
name: Check Code Changes
uses: ./.github/workflows/_check_code_changes.yml
with:
event_name: ${{ github.event_name }}
# For pull_request, use PR's base and head. For push, use event's before and sha.
base_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
head_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
report-no-code-changes:
needs: [check_code_changes]
runs-on: ubuntu-24.04
steps:
- name: Report no code changes
run: |
echo "No code changes were detected that require running the full test suite."
if: needs.check_code_changes.outputs.has_code_changes == 'false'
build-torch-xla:
name: "Build PyTorch/XLA"
uses: ./.github/workflows/_build_torch_xla.yml
needs: [check_code_changes]
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 }}
runner: linux.24xlarge
secrets:
gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}
test-python-cpu:
name: "CPU tests"
uses: ./.github/workflows/_test.yml
needs: [build-torch-xla, check_code_changes]
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm
timeout-minutes: 45 # Takes ~26m as of 2025/5/30.
collect-coverage: false
runner: linux.24xlarge
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
secrets:
gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}
test-tpu:
name: "TPU tests"
uses: ./.github/workflows/_tpu_ci.yml
needs: [build-torch-xla, check_code_changes]
with:
timeout-minutes: 75 # Takes ~40m as of 2025/5/30.
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
if: github.event_name == 'push' || github.event_name == 'pull_request'
test-torchprime:
name: "torchprime tests"
uses: ./.github/workflows/_torchprime_ci.yml
needs: [build-torch-xla, check_code_changes]
with:
timeout-minutes: 100
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
if: contains(github.event.pull_request.labels.*.name, 'torchprimeci')
secrets: inherit
push-docs:
name: "Build docs"
uses: ./.github/workflows/_docs.yml
needs: build-torch-xla
if: github.event_name == 'push'
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm
secrets:
torchxla-bot-token: ${{ secrets.TORCH_XLA_BOT_TOKEN }}