Skip to content

Commit cbd726f

Browse files
Copilotsofthack007
andcommitted
Fix YAML syntax error in workflow - proper Python heredoc indentation
Fixed GitHub Actions workflow YAML syntax error on line 112: **Problem:** The Python heredoc block had incorrect indentation causing YAML parser to fail with "error in your yaml syntax on line 112". **Root Cause:** In YAML, when using shell heredoc (<<EOF), the content must be properly indented relative to the YAML structure. The Python code was not indented, causing YAML to misinterpret the structure. **Fix:** - Properly indent Python code within the heredoc block - Python code now starts at correct indentation level for YAML - Changed << 'EOF' to <<'EOF' (no space, cleaner syntax) - All Python lines now properly indented to match YAML block scalar The workflow should now parse correctly and run the combined firmware image verification step. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
1 parent a8021b5 commit cbd726f

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

.github/workflows/wokwi-test.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -108,42 +108,42 @@ jobs:
108108
# Verify combined firmware image structure
109109
echo ""
110110
echo "Verifying combined firmware image structure..."
111-
python3 << 'EOF'
112-
import sys
113-
try:
114-
with open('firmware-combined.bin', 'rb') as f:
115-
data = f.read()
116-
117-
size_mb = len(data) / 1024 / 1024
118-
print(f"✓ Image size: {len(data)} bytes ({size_mb:.2f} MB)")
119-
120-
# Check bootloader at 0x1000
121-
if len(data) > 0x1000 and data[0x1000] == 0xe9:
122-
print("✓ Bootloader found at 0x1000 (magic byte: 0xe9)")
123-
else:
124-
print("⚠ Bootloader magic byte not found at 0x1000")
125-
sys.exit(1)
126-
127-
# Check partition table at 0x8000
128-
if len(data) > 0x8000 and data[0x8000:0x8002] == b'\xaa\x50':
129-
print("✓ Partition table found at 0x8000 (magic: 0xaa50)")
130-
else:
131-
print("⚠ Partition table magic not found at 0x8000")
132-
sys.exit(1)
133-
134-
# Check application at 0x10000
135-
if len(data) > 0x10000 and data[0x10000] == 0xe9:
136-
print("✓ Application found at 0x10000 (magic byte: 0xe9)")
137-
else:
138-
print("⚠ Application magic byte not found at 0x10000")
139-
sys.exit(1)
140-
141-
print("✅ Combined firmware image structure is valid")
142-
143-
except Exception as e:
144-
print(f"❌ ERROR verifying combined image: {e}")
145-
sys.exit(1)
146-
EOF
111+
python3 <<'EOF'
112+
import sys
113+
try:
114+
with open('firmware-combined.bin', 'rb') as f:
115+
data = f.read()
116+
117+
size_mb = len(data) / 1024 / 1024
118+
print(f"✓ Image size: {len(data)} bytes ({size_mb:.2f} MB)")
119+
120+
# Check bootloader at 0x1000
121+
if len(data) > 0x1000 and data[0x1000] == 0xe9:
122+
print("✓ Bootloader found at 0x1000 (magic byte: 0xe9)")
123+
else:
124+
print("⚠ Bootloader magic byte not found at 0x1000")
125+
sys.exit(1)
126+
127+
# Check partition table at 0x8000
128+
if len(data) > 0x8000 and data[0x8000:0x8002] == b'\xaa\x50':
129+
print("✓ Partition table found at 0x8000 (magic: 0xaa50)")
130+
else:
131+
print("⚠ Partition table magic not found at 0x8000")
132+
sys.exit(1)
133+
134+
# Check application at 0x10000
135+
if len(data) > 0x10000 and data[0x10000] == 0xe9:
136+
print("✓ Application found at 0x10000 (magic byte: 0xe9)")
137+
else:
138+
print("⚠ Application magic byte not found at 0x10000")
139+
sys.exit(1)
140+
141+
print("✅ Combined firmware image structure is valid")
142+
143+
except Exception as e:
144+
print(f"❌ ERROR verifying combined image: {e}")
145+
sys.exit(1)
146+
EOF
147147
148148
if [ $? -ne 0 ]; then
149149
echo "❌ Combined firmware image verification failed"

0 commit comments

Comments
 (0)