forked from ObKo/stm32-cmake
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ObKo#342 from xanthio/maintenance/dynamic-matrixing
Dynamic family matrix for CI jobs
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: MatrixCreator | ||
|
||
run-name: "Creates supported family matrix for other jobs" | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
matrix: | ||
description: "Supported family for job matrixing" | ||
value: ${{ jobs.CreateMatrix.outputs.matrix }} | ||
|
||
jobs: | ||
CreateMatrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.create-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout repo | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create matrix | ||
id: create-matrix | ||
run: | | ||
files=$(find cmake/stm32/ -name '*.cmake' -exec sh -c "basename {} | cut -f1 -d '.' | tr '[:lower:]' '[:upper:]'" \; | sort) | ||
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 |