-
Notifications
You must be signed in to change notification settings - Fork 9
157 lines (140 loc) · 5.01 KB
/
Copy pathnightly.yml
File metadata and controls
157 lines (140 loc) · 5.01 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Nightly Regression
on:
schedule:
- cron: "0 2 * * *" # 2:00 AM UTC daily
workflow_dispatch: # Manual trigger
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
native-build:
name: Native (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -B build -DEBLDR_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest --test-dir build --output-on-failure -C Release
cross-compile:
name: Cross (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64-linux
toolchain: toolchains/aarch64-linux-gnu.cmake
packages: gcc-aarch64-linux-gnu
- arch: riscv64-linux
toolchain: toolchains/riscv64-linux-gnu.cmake
packages: gcc-riscv64-linux-gnu
- arch: arm-cortex-m
toolchain: toolchains/arm-none-eabi.cmake
packages: gcc-arm-none-eabi libnewlib-arm-none-eabi
steps:
- uses: actions/checkout@v7
- name: Install cross-compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.packages }}
- name: Configure
run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build
- name: Verify artifacts
run: |
echo "=== Static libraries ==="
find build -name "*.a" | sort
LIB_COUNT=$(find build -name "*.a" | wc -l)
echo "Found $LIB_COUNT libraries"
if [ "$LIB_COUNT" -lt 1 ]; then
echo "ERROR: No libraries produced"
exit 1
fi
config-generation:
name: Config Generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r requirements.txt
- name: Test generate_config.py
run: |
cat > /tmp/test_boot.yaml << 'EOF'
boot:
board: stm32f4
arch: arm
flash_base: "0x08000000"
flash_size: 1048576
layout:
stage0: { offset: "0x0", size: 16384 }
stage1: { offset: "0x4000", size: 65536 }
bootctl_primary: { offset: "0x14000", size: 4096 }
bootctl_backup: { offset: "0x15000", size: 4096 }
slot_a: { offset: "0x16000", size: 479232 }
slot_b: { offset: "0x8B000", size: 479232 }
policy:
max_boot_attempts: 3
watchdog_timeout_ms: 5000
require_signature: true
EOF
python scripts/generate_config.py /tmp/test_boot.yaml /tmp/generated/
test -f /tmp/generated/eboot_generated_layout.h
test -f /tmp/generated/eboot_generated_memory.ld
echo "Config generation passed"
sanitizers:
name: Sanitizers (ASan + UBSan)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build with AddressSanitizer + UndefinedBehaviorSanitizer
run: |
cmake -B build-san \
-DCMAKE_BUILD_TYPE=Debug \
-DEBLDR_BUILD_TESTS=ON \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
cmake --build build-san -j$(nproc)
- name: Run tests under sanitizers
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1:abort_on_error=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
run: ctest --test-dir build-san --output-on-failure
report:
name: Nightly Report
runs-on: ubuntu-latest
needs: [native-build, cross-compile, config-generation, sanitizers]
if: always()
steps:
- name: Check results
run: |
echo "## Nightly Regression Report — eboot"
echo "Date: $(date -u '+%Y-%m-%d %H:%M UTC')"
echo ""
echo "| Job | Status |"
echo "|---|---|"
echo "| Native builds | ${{ needs.native-build.result }} |"
echo "| Cross-compile | ${{ needs.cross-compile.result }} |"
echo "| Config gen | ${{ needs.config-generation.result }} |"
echo "| Sanitizers | ${{ needs.sanitizers.result }} |"
if [ "${{ needs.native-build.result }}" != "success" ] || \
[ "${{ needs.cross-compile.result }}" != "success" ] || \
[ "${{ needs.config-generation.result }}" != "success" ] || \
[ "${{ needs.sanitizers.result }}" != "success" ]; then
echo ""
echo "❌ REGRESSION DETECTED"
exit 1
fi
echo ""
echo "✅ All checks passed"