11
11
type : string
12
12
description : Runner type for the test
13
13
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'
19
14
secrets :
20
15
torchxla-bot-token :
21
16
required : true
@@ -29,50 +24,42 @@ jobs:
29
24
BRANCH_NAME : ${{ github.ref_name }}
30
25
steps :
31
26
- name : Fetch wheels
32
- if : inputs.has_code_changes == 'true'
33
27
uses : actions/download-artifact@v4
34
28
with :
35
29
name : torch-xla-wheels
36
30
path : /tmp/wheels/
37
31
- name : Install wheels
38
- if : inputs.has_code_changes == 'true'
39
32
shell : bash
40
33
run : |
41
34
pip install /tmp/wheels/*.whl
42
35
- name : Checkout PyTorch/XLA Repo
43
- if : inputs.has_code_changes == 'true'
44
36
uses : actions/checkout@v4
45
37
with :
46
38
path : pytorch/xla
47
39
- name : Build docs
48
- if : inputs.has_code_changes == 'true'
49
40
shell : bash
50
41
run : |
51
42
cd pytorch/xla/docs
52
43
pip install -r requirements.txt
53
44
sphinx-build -b html source build
54
45
- name : Checkout GitHub Pages
55
- if : inputs.has_code_changes == 'true'
56
46
uses : actions/checkout@v4
57
47
with :
58
48
path : gh-pages
59
49
ref : gh-pages
60
50
token : ${{ github.event_name == 'push' && secrets.torchxla-bot-token || github.token }}
61
51
- name : Merge changes
62
- if : inputs.has_code_changes == 'true'
63
52
shell : bash
64
53
run : |
65
54
subdir=${{ env.BRANCH_NAME == 'master' && 'master' || format('{0}/{1}', 'release', env.BRANCH_NAME) }}
66
55
mkdir -p gh-pages/$subdir
67
56
cp -fR pytorch/xla/docs/build/* gh-pages/$subdir
68
57
- name : Upload preview as artifact
69
- if : inputs.has_code_changes == 'true'
70
58
uses : actions/upload-artifact@v4
71
59
with :
72
60
name : github-pages
73
61
path : pytorch/xla/docs/build/
74
62
- name : Deploy
75
- if : inputs.has_code_changes == 'true' && github.event_name == 'push'
76
63
shell : bash
77
64
run : |
78
65
cd gh-pages
81
68
git add . -v
82
69
git diff --cached --exit-code || git commit -m "Update doc from commit ${{ github.sha }}"
83
70
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."
0 commit comments