CI: rework build workflow to have split target and subtarget directly

Instead of referring to a redundant job and ENV variables, rework build
workflow to accept and require split target and subtarget and use them
directly from inputs.

Rework each user and pass a JSON of tuple to matrix include with each
target/subtarget combination to test. Special notice this doesn't use
the github actions matrix combination feature but reference each
specific tuple of target and subtarget to test.

Just a cleanup no behaviour change intended.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi
2023-05-22 16:47:08 +02:00
parent 6c80a578a4
commit eecc6e4811
6 changed files with 44 additions and 42 deletions

View File

@@ -40,8 +40,9 @@ jobs:
JSON='['
FIRST=1
for TARGET in $TARGETS; do
TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
[[ $FIRST -ne 1 ]] && JSON="$JSON"','
JSON="$JSON"'"'"${TARGET}"'"'
JSON="$JSON""$TUPLE"
FIRST=0
done
JSON="$JSON"']'
@@ -61,8 +62,9 @@ jobs:
strategy:
fail-fast: False
matrix:
target: ${{fromJson(needs.determine_targets.outputs.target)}}
include: ${{fromJson(needs.determine_targets.outputs.target)}}
uses: ./.github/workflows/build.yml
with:
target: ${{ matrix.target }}
subtarget: ${{ matrix.subtarget }}
build_toolchain: true