Skip to content

Commit 9ecfc00

Browse files
committed
create artifact list dynamically
1 parent 866d149 commit 9ecfc00

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

.github/workflows/build_artifacts.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ jobs:
6262
strategy:
6363
matrix:
6464
runner: ["windows-x86-n2-64", "linux-x86-n2-16", "linux-arm64-t2a-16"]
65-
artifact: ["jax", "jaxlib", "jax-cuda-pjrt", "jax-cuda-plugin"]
65+
artifact: >-
66+
${{ fromJSON((inputs.build_jax && '["jax"]') || '[]') }} +
67+
${{ fromJSON((inputs.build_jaxlib && '["jaxlib"]') || '[]') }} +
68+
${{ fromJSON((inputs.build_jax_cuda_pjrt && '["jax-cuda-pjrt"]') || '[]') }} +
69+
${{ fromJSON((inputs.build_jax_cuda_plugin && '["jax-cuda-plugin"]') || '[]') }}
6670
python: ["3.10"] #, "3.11", "3.12"]
6771
# jax-cuda-pjrt and jax are pure Python packages so they do not need to be built for each
6872
# Python version.
@@ -97,46 +101,20 @@ jobs:
97101
JAXCI_HERMETIC_PYTHON_VERSION: "${{ matrix.python }}"
98102
JAXCI_CLONE_MAIN_XLA: "${{ inputs.clone_main_xla }}"
99103

100-
if: inputs.build_jax || inputs.build_jaxlib || inputs.build_jax_cuda_plugin || inputs.build_jax_cuda_pjrt
101104
steps:
102105
- uses: actions/checkout@v3
103-
if: >-
104-
(inputs.build_jax && matrix.artifact == 'jax') ||
105-
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
106-
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
107-
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
108106
# Halt for testing
109107
- name: Wait For Connection
110108
uses: google-ml-infra/actions/ci_connection@main
111109
with:
112110
halt-dispatch-input: ${{ inputs.halt-for-connection }}
113-
if: >-
114-
(inputs.build_jax && matrix.artifact == 'jax') ||
115-
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
116-
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
117-
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
118111
- name: Build ${{ matrix.artifact }}
119-
if: >-
120-
(inputs.build_jax && matrix.artifact == 'jax') ||
121-
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
122-
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
123-
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
124112
run: ./ci/build_artifacts.sh "${{ matrix.artifact }}"
125113
- name: Set Platform
126-
if: >-
127-
(inputs.build_jax && matrix.artifact == 'jax') ||
128-
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
129-
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
130-
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
131114
run: |
132115
echo "PLATFORM=$(uname)_$(uname -m)" >> $GITHUB_ENV
133116
- name: Upload artifacts to GCS bucket
134117
# Upload if requested and one of the artifacts was built
135-
if: >-
136-
inputs.upload_artifacts &&
137-
(inputs.build_jax && matrix.artifact == 'jax') ||
138-
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
139-
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
140-
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
118+
if: inputs.upload_artifacts
141119
run: ~/usr/local/bin/google-cloud-sdk/bin/gsutil -m cp -r $(pwd)/dist gs://general-ml-ci-transient/jax-github-actions/"${{ inputs.upload_destination }}"/$PLATFORM
142120

0 commit comments

Comments
 (0)