CI: add action that prints info about submited BDF-s
authorRobert Marko <[email protected]>
Thu, 22 May 2025 09:30:00 +0000 (11:30 +0200)
committerRobert Marko <[email protected]>
Thu, 22 May 2025 11:43:50 +0000 (13:43 +0200)
Finally add an action that uses ath10k or ath11k bdencoder to print info
about the submited BDF.

End goal is faster reviews and sanity checking of the BDF.

Signed-off-by: Robert Marko <[email protected]>
.github/workflows/bdf.yaml [new file with mode: 0644]

diff --git a/.github/workflows/bdf.yaml b/.github/workflows/bdf.yaml
new file mode 100644 (file)
index 0000000..ded2d3e
--- /dev/null
@@ -0,0 +1,66 @@
+name: BDF info
+
+on: pull_request
+
+jobs:
+  determine_changed_files:
+    name: Determine Changed Files
+    uses: openwrt/actions-shared-workflows/.github/workflows/reusable_determine_changed_files.yml@main
+
+  determine_changed_bdfs:
+    name: Determine changed BDF-s
+    needs: determine_changed_files
+    runs-on: ubuntu-latest
+    outputs:
+      ath10k_changed_bdfs: ${{ steps.find_bdfs.outputs.ath10k_changed_bdfs }}
+      ath11k_changed_bdfs: ${{ steps.find_bdfs.outputs.ath11k_changed_bdfs }}
+
+    steps:
+      - name: Determine changed BDF-s
+        id: find_bdfs
+        run: |
+          # grep will return 1 if no matches, so ignore return code
+          set +e
+          # Find list of ath10k changed BDF-s
+          ATH10K_CHANGED_BDFS="$(echo ${{ needs.determine_changed_files.outputs.all_changed_files }} | tr ' ' '\n' | grep -E '.qca4019|.qca9888|.qca9889|.qca9984|.qca99x0')"
+
+          # Find list of ath11k changed BDF-s
+          ATH11K_CHANGED_BDFS="$(echo ${{ needs.determine_changed_files.outputs.all_changed_files }} | tr ' ' '\n' | grep -E '.ipq5018|.ipq6018|.ipq8074|.qcn6122|.qcn9074')"
+
+          echo "ath10k_changed_bdfs="$ATH10K_CHANGED_BDFS"" >> $GITHUB_OUTPUT
+          echo "ath11k_changed_bdfs="$ATH11K_CHANGED_BDFS"" >> $GITHUB_OUTPUT
+
+  print_bdf_info:
+    name: Print BDF info
+    if: ${{ needs.determine_changed_bdfs.outputs.ath10k_changed_bdfs != '' || needs.determine_changed_bdfs.outputs.ath11k_changed_bdfs != '' }}
+    needs: determine_changed_bdfs
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Get required tools
+        uses: actions/checkout@v4
+        with:
+          repository: qca/qca-swiss-army-knife
+          path: qca_tools
+          sparse-checkout: |
+            tools/scripts/ath10k/ath10k-bdencoder
+            tools/scripts/ath11k/ath11k-bdencoder
+          sparse-checkout-cone-mode: false
+
+      - name: Print ath10k BDF info
+        if: ${{ needs.determine_changed_bdfs.outputs.ath10k_changed_bdfs != '' }}
+        run: |
+          for BDF in ${{ needs.determine_changed_bdfs.outputs.ath10k_changed_bdfs }}; do
+            echo "BDF info for $BDF"
+            python qca_tools/tools/scripts/ath10k/ath10k-bdencoder -i "$BDF"
+          done
+
+      - name: Print ath11k BDF info
+        if: ${{ needs.determine_changed_bdfs.outputs.ath11k_changed_bdfs != '' }}
+        run: |
+          for BDF in ${{ needs.determine_changed_bdfs.outputs.ath11k_changed_bdfs }}; do
+          echo "BDF info for $BDF"
+            python qca_tools/tools/scripts/ath11k/ath11k-bdencoder -i "$BDF"
+          done