Skip to content

Commit 117186b

Browse files
committed
switch to 2 job strategy
1 parent 09c576b commit 117186b

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

.github/workflows/build_artifacts.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ on:
5353
type: string
5454

5555
jobs:
56+
determine_matrix:
57+
runs-on: linux-x86-n2-16
58+
container: 'us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build:latest')
59+
outputs:
60+
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
61+
steps:
62+
- id: set-matrix
63+
run: |
64+
matrix='[]'
65+
if ${{ inputs.build_jax }}; then
66+
matrix='["jax"]'
67+
if ${{ inputs.build_jaxlib }}; then
68+
matrix='["jax", "jaxlib"]'
69+
if ${{ inputs.build_jax_cuda_pjrt }}; then
70+
matrix='["jax", "jaxlib", "jax-cuda-pjrt"]'
71+
if ${{ inputs.build_jax_cuda_plugin }}; then
72+
matrix='["jax", "jaxlib", "jax-cuda-pjrt", "jax-cuda-plugin"]'
73+
fi
74+
fi
75+
fi
76+
fi
77+
echo "build_matrix=${matrix}" >> $GITHUB_OUTPUT
78+
5679
build_artifacts:
5780
continue-on-error: true
5881
defaults:
@@ -62,12 +85,7 @@ jobs:
6285
strategy:
6386
matrix:
6487
runner: ["windows-x86-n2-64", "linux-x86-n2-16", "linux-arm64-t2a-16"]
65-
artifact: >-
66-
${{ inputs.build_jax && inputs.build_jaxlib && inputs.build_jax_cuda_pjrt && inputs.build_jax_cuda_plugin && fromJSON('["jax", "jaxlib", "jax-cuda-pjrt", "jax-cuda-plugin"]') }} ||
67-
${{ inputs.build_jax && inputs.build_jaxlib && inputs.build_jax_cuda_pjrt && fromJSON('["jax", "jaxlib", "jax-cuda-pjrt"]') }} ||
68-
${{ inputs.build_jax && inputs.build_jaxlib && fromJSON('["jax", "jaxlib"]') }} ||
69-
${{ inputs.build_jax && fromJSON('["jax"]') }} ||
70-
${{ fromJSON('[]') }}
88+
artifact: ${{ fromJSON(needs.determine_matrix.outputs.build_matrix) }}
7189
python: ["3.10"] #, "3.11", "3.12"]
7290
# jax-cuda-pjrt and jax are pure Python packages so they do not need to be built for each
7391
# Python version.

0 commit comments

Comments
 (0)