From 4724ab704177581422f971d8589c5baa4af25693 Mon Sep 17 00:00:00 2001 From: Phred Date: Thu, 14 Aug 2025 18:52:21 -0500 Subject: [PATCH 1/2] chore(ci): use native jq functionality to construct matrix --- .github/workflows/build-native.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 83f7235ed..298d6f869 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -66,12 +66,11 @@ jobs: id: set-matrix # parse the Makefile to retrieve the list of targets in 'native-all', without 'native' run: | - matrix=$(( - echo '{ "target" : [' - sed -n "/^native-all *: */ { s///; p }" Makefile | sed "s/^native\s//g" | sed 's/ /, /g' | xargs -n 1 echo | sed -r 's/^([^,]*)(,?)$/"\1"\2/' - echo " ]}" - ) | jq -c .) - echo $matrix | jq . + matrix="$( + jq --compact-output --null-input '{ target: $ARGS.positional }' \ + --args $(awk '/^native-all.*:/ { $1 = $2 = ""; print }' Makefile) + )" + jq . <<< "$matrix" echo "matrix=$matrix" >> $GITHUB_OUTPUT build: From c6b1fd4b8cd5f61d28d17bcd8f43e9efb718052d Mon Sep 17 00:00:00 2001 From: Phred Date: Fri, 3 Jul 2026 18:37:11 -0500 Subject: [PATCH 2/2] moved more functionality into the `jq` query --- .github/workflows/build-native.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index cbbf5d745..c326ef369 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -17,8 +17,8 @@ jobs: # parse the Makefile to retrieve the list of targets in 'native-all', without 'native' run: | matrix="$( - jq --compact-output --null-input '{ target: $ARGS.positional }' \ - --args $(awk '/^native-all.*:/ { $1 = $2 = ""; print }' Makefile) + jq --compact-output --null-input '{ target: $ARGS.positional[2:] }' \ + --args $(grep '^native-all.*:' Makefile) )" jq . <<< "$matrix" echo "matrix=$matrix" >> $GITHUB_OUTPUT