summaryrefslogtreecommitdiffstats
path: root/.github/workflows/bdf.yaml
blob: eb001d08703f093f6f04830ba3d4cd6d5ed4c72d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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 }}
      ath12k_changed_bdfs: ${{ steps.find_bdfs.outputs.ath12k_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|.qca9988|.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')"

          # Find list of ath12k changed BDF-s
          ATH12K_CHANGED_BDFS="$(echo ${{ needs.determine_changed_files.outputs.all_changed_files }} | tr ' ' '\n' | grep -E '.qcn9274|.wcn7850')"

          echo "ath10k_changed_bdfs="$ATH10K_CHANGED_BDFS"" >> $GITHUB_OUTPUT
          echo "ath11k_changed_bdfs="$ATH11K_CHANGED_BDFS"" >> $GITHUB_OUTPUT
          echo "ath12k_changed_bdfs="$ATH12K_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.outputs.ath12k_changed_bdfs != '' }}
    needs: determine_changed_bdfs
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - name: Get required tools
        uses: actions/checkout@v6
        with:
          repository: qca/qca-swiss-army-knife
          path: qca_tools
          sparse-checkout: |
            tools/scripts/ath10k/ath10k-bdencoder
            tools/scripts/ath11k/ath11k-bdencoder
            tools/scripts/ath12k/ath12k-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

      - name: Print ath12k BDF info
        if: ${{ needs.determine_changed_bdfs.outputs.ath12k_changed_bdfs != '' }}
        run: |
          for BDF in ${{ needs.determine_changed_bdfs.outputs.ath12k_changed_bdfs }}; do
          echo "BDF info for $BDF"
            python qca_tools/tools/scripts/ath12k/ath12k-bdencoder -i "$BDF"
          done