Skip to content

Commit 05ac08f

Browse files
authored
Don't install wheels when building docs (#9153)
1 parent 1048005 commit 05ac08f

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

.github/workflows/_docs.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ on:
1111
type: string
1212
description: Runner type for the test
1313
default: linux.4xlarge
14-
has_code_changes:
15-
required: false
16-
type: string
17-
description: Whether to run full workflow or not
18-
default: 'true'
1914
secrets:
2015
torchxla-bot-token:
2116
required: true
@@ -29,50 +24,42 @@ jobs:
2924
BRANCH_NAME: ${{ github.ref_name }}
3025
steps:
3126
- name: Fetch wheels
32-
if: inputs.has_code_changes == 'true'
3327
uses: actions/download-artifact@v4
3428
with:
3529
name: torch-xla-wheels
3630
path: /tmp/wheels/
3731
- name: Install wheels
38-
if: inputs.has_code_changes == 'true'
3932
shell: bash
4033
run: |
4134
pip install /tmp/wheels/*.whl
4235
- name: Checkout PyTorch/XLA Repo
43-
if: inputs.has_code_changes == 'true'
4436
uses: actions/checkout@v4
4537
with:
4638
path: pytorch/xla
4739
- name: Build docs
48-
if: inputs.has_code_changes == 'true'
4940
shell: bash
5041
run: |
5142
cd pytorch/xla/docs
5243
pip install -r requirements.txt
5344
sphinx-build -b html source build
5445
- name: Checkout GitHub Pages
55-
if: inputs.has_code_changes == 'true'
5646
uses: actions/checkout@v4
5747
with:
5848
path: gh-pages
5949
ref: gh-pages
6050
token: ${{ github.event_name == 'push' && secrets.torchxla-bot-token || github.token }}
6151
- name: Merge changes
62-
if: inputs.has_code_changes == 'true'
6352
shell: bash
6453
run: |
6554
subdir=${{ env.BRANCH_NAME == 'master' && 'master' || format('{0}/{1}', 'release', env.BRANCH_NAME) }}
6655
mkdir -p gh-pages/$subdir
6756
cp -fR pytorch/xla/docs/build/* gh-pages/$subdir
6857
- name: Upload preview as artifact
69-
if: inputs.has_code_changes == 'true'
7058
uses: actions/upload-artifact@v4
7159
with:
7260
name: github-pages
7361
path: pytorch/xla/docs/build/
7462
- name: Deploy
75-
if: inputs.has_code_changes == 'true' && github.event_name == 'push'
7663
shell: bash
7764
run: |
7865
cd gh-pages
@@ -81,7 +68,3 @@ jobs:
8168
git add . -v
8269
git diff --cached --exit-code || git commit -m "Update doc from commit ${{ github.sha }}"
8370
git push origin gh-pages
84-
- name: Report no code changes
85-
if: inputs.has_code_changes == 'false'
86-
run: |
87-
echo "No code changes were detected that require running the full test suite."

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ jobs:
129129
name: "Build docs"
130130
uses: ./.github/workflows/_docs.yml
131131
needs: build-torch-xla
132+
if: github.event_name == 'push'
132133
with:
133134
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.10_tpuvm
134135
secrets:

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
mistune==0.8.4
2-
sphinx==5.3.0
3-
docutils==0.16
41
Jinja2==3.1.3
2+
docutils==0.16
53
m2r
4+
mistune==0.8.4
5+
sphinx==5.3.0
66
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

0 commit comments

Comments
 (0)