From f3e1937338699dc52b1095b269875c369b34c67c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 8 Nov 2023 01:42:15 +0530 Subject: [PATCH] ci: Add a workflow to check Wi-Fi FW patch version This workflow checks the version between the C header and the firmware patch bins and leaves a comment. Signed-off-by: Chaitanya Tata --- .github/workflows/check_wifi_fw_patch.yml | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/check_wifi_fw_patch.yml diff --git a/.github/workflows/check_wifi_fw_patch.yml b/.github/workflows/check_wifi_fw_patch.yml new file mode 100644 index 0000000000..ef82b205a4 --- /dev/null +++ b/.github/workflows/check_wifi_fw_patch.yml @@ -0,0 +1,37 @@ +name: Verify nRF70 Wi-Fi firmware patch version +on: pull_request +env: + PATCH_INFO_FILE: 'nrf_wifi/fw_if/umac_if/inc/fw/patch_info.h' + PATCH_BIN_BASE: 'nrf_wifi/fw_bins' +jobs: + verify: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Extract patch version + run: | + echo ${{ env.PATCH_INFO_FILE }} | grep "#define RPU_" | awk '{print $3}' | tr -d '()' | paste -sd "." + id: patch_version + - name: Verify patch version + run: | + for patch in $(find ${{ env.PATCH_BIN_BASE }} -name 'nrf70.bin'); do + echo "Verifying $patch" + patch_version=$(hexdump -s 4 -n 4 -e '16/1 "%x " "\n"' $patch | tr -d ' ' | rev | sed 's/.\{1\}/&./g' | sed 's/.$//') + echo "Patch version: $patch_version" + if [ "${{ steps.patch_version.outputs.patch_version }}" != "$patch_version" ]; then + echo "Patch version mismatch" + exit 1 + fi + done + - name: Comment on PR + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Patch version verified: ${{ steps.patch_version.outputs.patch_version }}' + })