diff --git a/.github/workflows/create-matrix.yml b/.github/workflows/create-matrix.yml index 41c66270..a62ace07 100644 --- a/.github/workflows/create-matrix.yml +++ b/.github/workflows/create-matrix.yml @@ -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