-
Notifications
You must be signed in to change notification settings - Fork 314
40 lines (40 loc) · 1.59 KB
/
check_wifi_fw_patch.yml
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
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_BINS: |
- system: 'nrf_wifi/fw_bins/default/nrf70.bin'
- radio_test: 'nrf_wifi/fw_bins/radio_test/nrf70.bin'
- scan_only: 'nrf_wifi/fw_bins/scan_only/nrf70.bin'
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 ${{ env.PATCH_BINS }}; do
echo "Verifying $patch"
patch_version=$(hexdump -s 4 -n 4 -e '16/1 "%x " "\n"' nrf_wifi/fw_bins/default/nrf70.bin | 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 }}'
})