create-matrix.yml 924 B

123456789101112131415161718192021222324252627282930
  1. name: MatrixCreator
  2. run-name: "Creates supported family matrix for other jobs"
  3. on:
  4. workflow_call:
  5. outputs:
  6. matrix:
  7. description: "Supported family for job matrixing"
  8. value: ${{ jobs.CreateMatrix.outputs.matrix }}
  9. jobs:
  10. CreateMatrix:
  11. runs-on: ubuntu-latest
  12. outputs:
  13. matrix: ${{ steps.create-matrix.outputs.matrix }}
  14. steps:
  15. - name: Checkout repo
  16. id: checkout
  17. uses: actions/checkout@v4
  18. - name: Create matrix
  19. id: create-matrix
  20. run: |
  21. files=$(find cmake/stm32/ -name '*.cmake' -exec sh -c "basename {} | cut -f1 -d '.' | tr '[:lower:]' '[:upper:]'" \; | sort)
  22. deletes="COMMON DEVICES LINKER_LD"
  23. for del in $deletes; do
  24. files=(${files[@]/$del})
  25. done
  26. echo "matrix={\"family\":$(jq --compact-output --null-input '$ARGS.positional' --args -- ${files[@]})}" >> $GITHUB_OUTPUT