Skip to content

Commit 08b09a0

Browse files
facontidavideclaude
andcommitted
Fix conda CI: use dynamic matrix for distro filtering
Job-level if cannot reference matrix context. Use a setup job to compute the matrix JSON based on workflow_dispatch input. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: bfc5076b5a8e
1 parent a8cafa2 commit 08b09a0

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/conda.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,28 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
jobs:
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
matrix: ${{ steps.set.outputs.matrix }}
32+
steps:
33+
- id: set
34+
run: |
35+
if [[ "$DISTRO" == "all" || -z "$DISTRO" ]]; then
36+
echo 'matrix={"include":[{"ros_distro":"humble","robostack_channel":"robostack-humble"},{"ros_distro":"jazzy","robostack_channel":"robostack-jazzy"},{"ros_distro":"kilted","robostack_channel":"robostack-kilted"}]}' >> "$GITHUB_OUTPUT"
37+
else
38+
echo "matrix={\"include\":[{\"ros_distro\":\"$DISTRO\",\"robostack_channel\":\"robostack-$DISTRO\"}]}" >> "$GITHUB_OUTPUT"
39+
fi
40+
env:
41+
DISTRO: ${{ inputs.ros_distro }}
42+
2843
build:
44+
needs: setup
2945
strategy:
3046
fail-fast: false
31-
matrix:
32-
include:
33-
- ros_distro: humble
34-
robostack_channel: robostack-humble
35-
- ros_distro: jazzy
36-
robostack_channel: robostack-jazzy
37-
- ros_distro: kilted
38-
robostack_channel: robostack-kilted
47+
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
3948
runs-on: ubuntu-latest
4049
name: conda-${{ matrix.ros_distro }}
41-
if: >-
42-
inputs.ros_distro == '' || inputs.ros_distro == 'all'
43-
|| inputs.ros_distro == matrix.ros_distro
4450

4551
steps:
4652
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)