Skip to content

Commit 1c1c67a

Browse files
committed
Run checks in separate script
1 parent 52aec5a commit 1c1c67a

File tree

2 files changed

+53
-48
lines changed

2 files changed

+53
-48
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Pass updated files in $updated_files environment variable
4+
5+
# enc_bootloader
6+
echo "$updated_files" | grep -q "enc_bootloader/.*\.elf"
7+
enc_bootloader_elf_not_updated=$?
8+
if [ $enc_bootloader_elf_not_updated -eq 1 ]; then
9+
echo "Checking enc_bootloader files for modifications as ELFs have not been updated"
10+
for file in enc_bootloader/*; do
11+
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
12+
continue
13+
fi
14+
if echo "$updated_files" | grep -q "$file"; then
15+
echo "File $file is in the PR but enc_bootloader ELFs have not been updated"
16+
exit 1
17+
fi
18+
done
19+
fi
20+
21+
# picoboot_flash_id
22+
echo "$updated_files" | grep -q "picoboot_flash_id/.*\.bin"
23+
flash_id_bin_not_updated=$?
24+
if [ $flash_id_bin_not_updated -eq 1 ]; then
25+
echo "Checking picoboot_flash_id files for modifications as BINs have not been updated"
26+
for file in picoboot_flash_id/*; do
27+
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
28+
continue
29+
fi
30+
if echo "$updated_files" | grep -q "$file"; then
31+
echo "File $file is in the PR but flash_id BINs have not been updated"
32+
exit 1
33+
fi
34+
done
35+
fi
36+
37+
# xip_ram_perms
38+
echo "$updated_files" | grep -q "xip_ram_perms/.*\.elf"
39+
xip_ram_perms_elf_not_updated=$?
40+
if [ $xip_ram_perms_elf_not_updated -eq 1 ]; then
41+
echo "Checking xip_ram_perms files for modifications as ELFs have not been updated"
42+
for file in xip_ram_perms/*; do
43+
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
44+
continue
45+
fi
46+
if echo "$updated_files" | grep -q "$file"; then
47+
echo "File $file is in the PR but xip_ram_perms ELFs have not been updated"
48+
exit 1
49+
fi
50+
done
51+
fi

.github/workflows/check_precompiled.yml

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,9 @@ jobs:
3636
updated_files=$(curl -s -u "${{ github.repository_owner }}":"${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${{ github.event.pull_request._links.self.href }}/files")
3737
updated_files=$(jq -r '.[] | .filename' <<<"$updated_files")
3838
39+
export updated_files
3940
echo "Updated files: $updated_files"
40-
41-
# enc_bootloader
42-
echo "$updated_files" | grep -q "enc_bootloader/.*\.elf"
43-
enc_bootloader_elf_not_updated=$?
44-
if [ $enc_bootloader_elf_not_updated -eq 1 ]; then
45-
echo "Checking enc_bootloader files for modifications as ELFs have not been updated"
46-
for file in enc_bootloader/*; do
47-
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
48-
continue
49-
fi
50-
if echo "$updated_files" | grep -q "$file"; then
51-
echo "File $file is in the PR but enc_bootloader ELFs have not been updated"
52-
exit 1
53-
fi
54-
done
55-
fi
56-
57-
# picoboot_flash_id
58-
echo "$updated_files" | grep -q "picoboot_flash_id/.*\.bin"
59-
flash_id_bin_not_updated=$?
60-
if [ $flash_id_bin_not_updated -eq 1 ]; then
61-
echo "Checking picoboot_flash_id files for modifications as BINs have not been updated"
62-
for file in picoboot_flash_id/*; do
63-
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
64-
continue
65-
fi
66-
if echo "$updated_files" | grep -q "$file"; then
67-
echo "File $file is in the PR but flash_id BINs have not been updated"
68-
exit 1
69-
fi
70-
done
71-
fi
72-
73-
# xip_ram_perms
74-
echo "$updated_files" | grep -q "xip_ram_perms/.*\.elf"
75-
xip_ram_perms_elf_not_updated=$?
76-
if [ $xip_ram_perms_elf_not_updated -eq 1 ]; then
77-
echo "Checking xip_ram_perms files for modifications as ELFs have not been updated"
78-
for file in xip_ram_perms/*; do
79-
if echo "$file" | grep -q "CMakeLists.txt" || echo "$file" | grep -q "BUILD.bazel"; then
80-
continue
81-
fi
82-
if echo "$updated_files" | grep -q "$file"; then
83-
echo "File $file is in the PR but xip_ram_perms ELFs have not been updated"
84-
exit 1
85-
fi
86-
done
87-
fi
41+
./.github/workflows/check_precompiled.sh
8842
8943
- name: Upload new precompiled binaries
9044
if: always()

0 commit comments

Comments
 (0)