Przeglądaj źródła

split matrix creation into steps

Maxime JOURDAN - XANTHIO 1 rok temu
rodzic
commit
e067e06b7e
1 zmienionych plików z 15 dodań i 4 usunięć
  1. 15 4
      .github/workflows/create-matrix.yml

+ 15 - 4
.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 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