-
Notifications
You must be signed in to change notification settings - Fork 571
97 lines (89 loc) · 3.64 KB
/
Copy pathbuild_and_test.yml
File metadata and controls
97 lines (89 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and test
on:
pull_request:
branches:
- master
- r[0-9]+.[0-9]+
push:
branches:
- master
- r[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 }}
get-torch-commit:
needs: [check_code_changes]
runs-on: ubuntu-24.04
outputs:
torch_commit: ${{ steps.commit.outputs.torch_commit }}
steps:
- name: Get latest torch commit
id: commit
if: needs.check_code_changes.outputs.has_code_changes == 'true'
run: |
echo "torch_commit=$(git ls-remote https://github.com/pytorch/pytorch.git refs/heads/release/2.8 | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- name: Report no code changes
if: needs.check_code_changes.outputs.has_code_changes == 'false'
run: |
echo "No code changes were detected that require running the full test suite."
build-torch-xla:
name: "Build PyTorch/XLA"
uses: ./.github/workflows/_build_torch_xla.yml
needs: [check_code_changes, get-torch-commit]
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm
torch-commit: ${{needs.get-torch-commit.outputs.torch_commit}}
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, get-torch-commit]
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
torch-commit: ${{needs.get-torch-commit.outputs.torch_commit}}
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: github.event_name == 'push' || github.event_name == 'pull_request'
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 }}