Skip to content

Commit

Permalink
split matrix creation into steps
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthio committed Jun 5, 2024
1 parent eb1e312 commit 9b4a624
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/create-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Create matrix
id: create-matrix
- name: Get uppercase no-extension ordered file names
id: find-files
run: |
files=$(find ${{ runner.workspace }}/cmake/stm32/ -name '*.cmake' -exec sh -c "basename {} | cut -f1 -d '.' | tr '[:lower:]' '[:upper:]'" \; | sort)
echo "files=\"${files[@]\"" >> GITHUB_OUTPUT
- name: Filter out non family files
id: get-famillies
run: |
files=$(find cmake/stm32/ -name '*.cmake' -exec sh -c "basename {} | cut -f1 -d '.' | tr '[:lower:]' '[:upper:]'" \; | sort)
files=${{ steps.find-files.outputs.files }}
deletes="COMMON DEVICES LINKER_LD"
for del in $deletes; do
files=(${files[@]/$del})
done
echo "matrix={\"family\":$(jq --compact-output --null-input '$ARGS.positional' --args -- ${files[@]})}" >> $GITHUB_OUTPUT
echo "files=\"${files[@]\"" >> GITHUB_OUTPUT
- name: Create matrix
id: create-matrix
run: |
echo "matrix={\"family\":$(jq --compact-output --null-input '$ARGS.positional' --args -- ${{ steps.get-famillies.outputs.files }})}" >> $GITHUB_OUTPUT

0 comments on commit 9b4a624

Please sign in to comment.