Skip to content

Commit e17bdfb

Browse files
committed
Convert has_code_changes var to string since job outputs are always strings
1 parent 6f881ee commit e17bdfb

7 files changed

+67
-67
lines changed

.github/workflows/_build_plugin.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ on:
1818
default: 120
1919
has_code_changes:
2020
required: false
21-
type: boolean
21+
type: string
2222
description: Whether to run full workflow or not
23-
default: true
23+
default: 'true'
2424
secrets:
2525
gcloud-service-key:
2626
required: true
@@ -37,31 +37,31 @@ jobs:
3737
BAZEL_REMOTE_CACHE: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
3838
steps:
3939
- name: Checkout actions
40-
if: ${{ inputs.has_code_changes }}
40+
if: ${{ inputs.has_code_changes }} == 'true'
4141
uses: actions/checkout@v4
4242
with:
4343
sparse-checkout: |
4444
.github/workflows/setup
4545
path: .actions
4646
- name: Setup
47-
if: ${{ inputs.has_code_changes }}
47+
if: ${{ inputs.has_code_changes }} == 'true'
4848
uses: ./.actions/.github/workflows/setup
4949
with:
5050
torch-commit: ${{ inputs.torch-commit }}
5151
cuda: true
5252
- name: Build
53-
if: ${{ inputs.has_code_changes }}
53+
if: ${{ inputs.has_code_changes }} == 'true'
5454
shell: bash
5555
run: |
5656
cd pytorch/xla/infra/ansible
5757
ansible-playbook playbook.yaml -vvv -e "stage=build_plugin arch=amd64 accelerator=cuda cuda_compute_capabilities=5.2,7.5,8.6 src_root=${GITHUB_WORKSPACE} cache_suffix=-ci" --skip-tags=fetch_srcs,install_deps
5858
- name: Upload wheel
59-
if: ${{ inputs.has_code_changes }}
59+
if: ${{ inputs.has_code_changes }} == 'true'
6060
uses: actions/upload-artifact@v4
6161
with:
6262
name: cuda-plugin
6363
path: /dist/*.whl
6464
- name: Report no code changes
65-
if: ${{ !inputs.has_code_changes }}
65+
if: ${{ inputs.has_code_changes }} == 'false'
6666
run: |
6767
echo "No code changes were detected that require running the full test suite."

.github/workflows/_build_torch_with_cuda.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ on:
2222
default: 120
2323
has_code_changes:
2424
required: false
25-
type: boolean
25+
type: string
2626
description: Whether to run full workflow or not
27-
default: true
27+
default: 'true'
2828
jobs:
2929
build:
3030
runs-on: ${{ inputs.runner }}
@@ -38,31 +38,31 @@ jobs:
3838
MAX_JOBS: 24
3939
steps:
4040
- name: Checkout actions
41-
if: ${{ inputs.has_code_changes }}
41+
if: ${{ inputs.has_code_changes }} == 'true'
4242
uses: actions/checkout@v4
4343
with:
4444
sparse-checkout: |
4545
.github/workflows/setup
4646
path: .actions
4747
- name: Setup
48-
if: ${{ inputs.has_code_changes }}
48+
if: ${{ inputs.has_code_changes }} == 'true'
4949
uses: ./.actions/.github/workflows/setup
5050
with:
5151
torch-commit: ${{ inputs.torch-commit }}
5252
cuda: true
5353
- name: Build PyTorch with CUDA enabled
54-
if: ${{ inputs.has_code_changes }}
54+
if: ${{ inputs.has_code_changes }} == 'true'
5555
shell: bash
5656
run: |
5757
cd pytorch
5858
python setup.py bdist_wheel
5959
- name: Upload wheel
60-
if: ${{ inputs.has_code_changes }}
60+
if: ${{ inputs.has_code_changes }} == 'true'
6161
uses: actions/upload-artifact@v4
6262
with:
6363
name: torch-with-cuda
6464
path: pytorch/dist/*.whl
6565
- name: Report no code changes
66-
if: ${{ !inputs.has_code_changes }}
66+
if: ${{ inputs.has_code_changes }} == 'false'
6767
run: |
6868
echo "No code changes were detected that require running the full test suite."

.github/workflows/_build_torch_xla.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ on:
2222
default: 120
2323
has_code_changes:
2424
required: false
25-
type: boolean
25+
type: string
2626
description: Whether to run full workflow or not
27-
default: true
27+
default: 'true'
2828
secrets:
2929
gcloud-service-key:
3030
required: true
@@ -44,37 +44,37 @@ jobs:
4444
# Need to check out local composite actions before using them
4545
# https://github.com/orgs/community/discussions/11771
4646
- name: Checkout actions
47-
if: ${{ inputs.has_code_changes }}
47+
if: ${{ inputs.has_code_changes }} == 'true'
4848
uses: actions/checkout@v4
4949
with:
5050
sparse-checkout: |
5151
.github/workflows/setup
5252
path: .actions
5353
- name: Setup
54-
if: ${{ inputs.has_code_changes }}
54+
if: ${{ inputs.has_code_changes }} == 'true'
5555
uses: ./.actions/.github/workflows/setup
5656
with:
5757
torch-commit: ${{ inputs.torch-commit }}
5858
- name: Build
59-
if: ${{ inputs.has_code_changes }}
59+
if: ${{ inputs.has_code_changes }} == 'true'
6060
shell: bash
6161
run: |
6262
cd pytorch/xla/infra/ansible
6363
ansible-playbook playbook.yaml -vvv -e "stage=build arch=amd64 accelerator=tpu src_root=${GITHUB_WORKSPACE} bundle_libtpu=0 build_cpp_tests=1 git_versioned_xla_build=1 cache_suffix=-ci" --skip-tags=fetch_srcs,install_deps
6464
- name: Upload wheel
65-
if: ${{ inputs.has_code_changes }}
65+
if: ${{ inputs.has_code_changes }} == 'true'
6666
uses: actions/upload-artifact@v4
6767
with:
6868
name: torch-xla-wheels
6969
path: /dist/*.whl
7070
- name: Upload CPP test binaries
71-
if: ${{ inputs.has_code_changes }}
71+
if: ${{ inputs.has_code_changes }} == 'true'
7272
uses: actions/upload-artifact@v4
7373
with:
7474
name: cpp-test-bin
7575
path: /tmp/test/bin
7676
- name: Report no code changes
77-
if: ${{ !inputs.has_code_changes }}
77+
if: ${{ inputs.has_code_changes }} == 'false'
7878
run: |
7979
echo "No code changes were detected that require running the full test suite."
8080

.github/workflows/_docs.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ on:
1313
default: linux.4xlarge
1414
has_code_changes:
1515
required: false
16-
type: boolean
16+
type: string
1717
description: Whether to run full workflow or not
18-
default: true
18+
default: 'true'
1919
secrets:
2020
torchxla-bot-token:
2121
required: true
@@ -29,50 +29,50 @@ jobs:
2929
BRANCH_NAME: ${{ github.ref_name }}
3030
steps:
3131
- name: Fetch wheels
32-
if: ${{ inputs.has_code_changes }}
32+
if: ${{ inputs.has_code_changes }} == 'true'
3333
uses: actions/download-artifact@v4
3434
with:
3535
name: torch-xla-wheels
3636
path: /tmp/wheels/
3737
- name: Install wheels
38-
if: ${{ inputs.has_code_changes }}
38+
if: ${{ inputs.has_code_changes }} == 'true'
3939
shell: bash
4040
run: |
4141
pip install /tmp/wheels/*.whl
4242
- name: Checkout PyTorch/XLA Repo
43-
if: ${{ inputs.has_code_changes }}
43+
if: ${{ inputs.has_code_changes }} == 'true'
4444
uses: actions/checkout@v4
4545
with:
4646
path: pytorch/xla
4747
- name: Build docs
48-
if: ${{ inputs.has_code_changes }}
48+
if: ${{ inputs.has_code_changes }} == 'true'
4949
shell: bash
5050
run: |
5151
cd pytorch/xla/docs
5252
pip install -r requirements.txt
5353
sphinx-build -b html source build
5454
- name: Checkout GitHub Pages
55-
if: ${{ inputs.has_code_changes }}
55+
if: ${{ inputs.has_code_changes }} == 'true'
5656
uses: actions/checkout@v4
5757
with:
5858
path: gh-pages
5959
ref: gh-pages
6060
token: ${{ github.event_name == 'push' && secrets.torchxla-bot-token || github.token }}
6161
- name: Merge changes
62-
if: ${{ inputs.has_code_changes }}
62+
if: ${{ inputs.has_code_changes }} == 'true'
6363
shell: bash
6464
run: |
6565
subdir=${{ env.BRANCH_NAME == 'master' && 'master' || format('{0}/{1}', 'release', env.BRANCH_NAME) }}
6666
mkdir -p gh-pages/$subdir
6767
cp -fR pytorch/xla/docs/build/* gh-pages/$subdir
6868
- name: Upload preview as artifact
69-
if: ${{ inputs.has_code_changes }}
69+
if: ${{ inputs.has_code_changes }} == 'true'
7070
uses: actions/upload-artifact@v4
7171
with:
7272
name: github-pages
7373
path: pytorch/xla/docs/build/
7474
- name: Deploy
75-
if: ${{ inputs.has_code_changes }} && github.event_name == 'push'
75+
if: ${{ inputs.has_code_changes }} == 'true' && github.event_name == 'push'
7676
shell: bash
7777
run: |
7878
cd gh-pages
@@ -82,6 +82,6 @@ jobs:
8282
git diff --cached --exit-code || git commit -m "Update doc from commit ${{ github.sha }}"
8383
git push origin gh-pages
8484
- name: Report no code changes
85-
if: ${{ !inputs.has_code_changes }}
85+
if: ${{ inputs.has_code_changes }} == 'false'
8686
run: |
8787
echo "No code changes were detected that require running the full test suite."

.github/workflows/_test.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ on:
3434
description: torch-commit
3535
has_code_changes:
3636
required: false
37-
type: boolean
37+
type: string
3838
description: Whether to run full workflow or not
39-
default: true
39+
default: 'true'
4040
secrets:
4141
gcloud-service-key:
4242
required: true
@@ -82,57 +82,57 @@ jobs:
8282
BAZEL_REMOTE_CACHE: 1
8383
steps:
8484
- name: Checkout actions
85-
if: ${{ inputs.has_code_changes }}
85+
if: ${{ inputs.has_code_changes }} == 'true'
8686
uses: actions/checkout@v4
8787
with:
8888
sparse-checkout: |
8989
.github/workflows/setup
9090
path: .actions
9191
- name: Setup
92-
if: ${{ inputs.has_code_changes }}
92+
if: ${{ inputs.has_code_changes }} == 'true'
9393
uses: ./.actions/.github/workflows/setup
9494
with:
9595
torch-commit: ${{ inputs.torch-commit }}
9696
cuda: ${{ inputs.install-cuda-plugin && true || false }}
9797
wheels-artifact: torch-xla-wheels
9898
cuda-plugin-artifact: ${{ inputs.install-cuda-plugin && 'cuda-plugin' || null }}
9999
- name: Fetch CPP test binaries
100-
if: ${{ inputs.has_code_changes }} && ${{ matrix.run_cpp_tests }}
100+
if: ${{ inputs.has_code_changes }} == 'true' && ${{ matrix.run_cpp_tests }}
101101
uses: actions/download-artifact@v4
102102
with:
103103
name: cpp-test-bin
104104
path: /tmp/test/bin
105105
# GitHub Actions doesn't preserve executable permissions
106106
# https://github.com/actions/download-artifact?tab=readme-ov-file#permission-loss
107107
- name: Set CPP test permissions
108-
if: ${{ inputs.has_code_changes }} && ${{ matrix.run_cpp_tests }}
108+
if: ${{ inputs.has_code_changes }} == 'true' && ${{ matrix.run_cpp_tests }}
109109
run: |
110110
chmod +x /tmp/test/bin/*
111111
ls -l /tmp/test/bin
112112
- name: Check GPU
113-
if: ${{ inputs.has_code_changes }} && ${{ inputs.install-cuda-plugin }}
113+
if: ${{ inputs.has_code_changes }} == 'true' && ${{ inputs.install-cuda-plugin }}
114114
run: nvidia-smi
115115
- name: Install test deps
116-
if: ${{ inputs.has_code_changes }}
116+
if: ${{ inputs.has_code_changes }} == 'true'
117117
shell: bash
118118
run: |
119119
# TODO: Add these in setup.py
120120
pip install fsspec
121121
pip install rich
122122
- name: Checkout PyTorch Repo
123-
if: ${{ inputs.has_code_changes }}
123+
if: ${{ inputs.has_code_changes }} == 'true'
124124
uses: actions/checkout@v4
125125
with:
126126
repository: pytorch/pytorch
127127
path: pytorch
128128
ref: ${{ inputs.torch-commit }}
129129
- name: Checkout PyTorch/XLA Repo
130-
if: ${{ inputs.has_code_changes }}
130+
if: ${{ inputs.has_code_changes }} == 'true'
131131
uses: actions/checkout@v4
132132
with:
133133
path: pytorch/xla
134134
- name: Extra CI deps
135-
if: ${{ inputs.has_code_changes }}
135+
if: ${{ inputs.has_code_changes }} == 'true'
136136
shell: bash
137137
run: |
138138
set -x
@@ -143,11 +143,11 @@ jobs:
143143
pip install -r pytorch/xla/benchmarks/requirements.txt
144144
fi
145145
- name: Test
146-
if: ${{ inputs.has_code_changes }}
146+
if: ${{ inputs.has_code_changes }} == 'true'
147147
shell: bash
148148
run: pytorch/xla/.github/scripts/run_tests.sh pytorch/ pytorch/xla/ $USE_COVERAGE
149149
- name: Upload coverage results
150-
if: ${{ inputs.has_code_changes }} && ${{ inputs.collect-coverage }}
150+
if: ${{ inputs.has_code_changes }} == 'true' && ${{ inputs.collect-coverage }}
151151
shell: bash
152152
env:
153153
CIRCLE_WORKFLOW_ID: ${{ github.run_id }}
@@ -192,6 +192,6 @@ jobs:
192192
fi
193193
fi
194194
- name: Report no code changes
195-
if: ${{ !inputs.has_code_changes }}
195+
if: ${{ inputs.has_code_changes }} == 'false'
196196
run: |
197197
echo "No code changes were detected that require running the full test suite."

0 commit comments

Comments
 (0)