forked from ruvnet/RuView
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (87 loc) · 3.21 KB
/
firmware-ci.yml
File metadata and controls
100 lines (87 loc) · 3.21 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Firmware CI
on:
push:
paths:
- 'firmware/**'
- '.github/workflows/firmware-ci.yml'
pull_request:
paths:
- 'firmware/**'
- '.github/workflows/firmware-ci.yml'
jobs:
build:
name: Build ESP32-S3 Firmware
runs-on: ubuntu-latest
container:
image: espressif/idf:v5.2
steps:
- uses: actions/checkout@v4
- name: Build firmware
working-directory: firmware/esp32-csi-node
run: |
. $IDF_PATH/export.sh
idf.py set-target esp32s3
idf.py build
- name: Verify binary size (< 950 KB gate)
working-directory: firmware/esp32-csi-node
run: |
BIN=build/esp32-csi-node.bin
SIZE=$(stat -c%s "$BIN")
MAX=$((950 * 1024))
echo "Binary size: $SIZE bytes ($(( SIZE / 1024 )) KB)"
echo "Size limit: $MAX bytes (950 KB — includes Tier 3 WASM runtime)"
if [ "$SIZE" -gt "$MAX" ]; then
echo "::error::Firmware binary exceeds 950 KB size gate ($SIZE > $MAX)"
exit 1
fi
echo "Binary size OK: $SIZE <= $MAX"
- name: Verify flash image integrity
working-directory: firmware/esp32-csi-node
run: |
ERRORS=0
BIN=build/esp32-csi-node.bin
# Check binary exists and is non-empty.
if [ ! -s "$BIN" ]; then
echo "::error::Binary not found or empty"
exit 1
fi
# Check partition table magic (0xAA50 at offset 0).
PT=build/partition_table/partition-table.bin
if [ -f "$PT" ]; then
MAGIC=$(xxd -l2 -p "$PT")
if [ "$MAGIC" != "aa50" ]; then
echo "::warning::Partition table magic mismatch: $MAGIC (expected aa50)"
ERRORS=$((ERRORS + 1))
fi
fi
# Check bootloader exists.
BL=build/bootloader/bootloader.bin
if [ ! -s "$BL" ]; then
echo "::warning::Bootloader binary missing or empty"
ERRORS=$((ERRORS + 1))
fi
# Verify non-zero data in binary (not all 0xFF padding).
NONZERO=$(xxd -l 1024 -p "$BIN" | tr -d 'f' | wc -c)
if [ "$NONZERO" -lt 100 ]; then
echo "::error::Binary appears to be mostly padding (non-zero chars: $NONZERO)"
ERRORS=$((ERRORS + 1))
fi
if [ "$ERRORS" -gt 0 ]; then
echo "::warning::Flash image verification completed with $ERRORS warning(s)"
else
echo "Flash image integrity verified"
fi
- name: Check QEMU ESP32-S3 support status
run: |
echo "::notice::ESP32-S3 QEMU support is experimental in ESP-IDF v5.4. "
echo "Full smoke testing requires QEMU 8.2+ with xtensa-esp32s3 target."
echo "See: https://github.com/espressif/qemu/wiki"
- name: Upload firmware artifact
uses: actions/upload-artifact@v4
with:
name: esp32-csi-node-firmware
path: |
firmware/esp32-csi-node/build/esp32-csi-node.bin
firmware/esp32-csi-node/build/bootloader/bootloader.bin
firmware/esp32-csi-node/build/partition_table/partition-table.bin
retention-days: 30