|
| 1 | +name: Nightly Regression |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "0 2 * * *" # 2:00 AM UTC daily |
| 6 | + workflow_dispatch: # Manual trigger |
| 7 | + |
| 8 | +jobs: |
| 9 | + native-build: |
| 10 | + name: Native (${{ matrix.os }}) |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Configure |
| 20 | + run: cmake -B build -DEBLDR_BUILD_TESTS=ON |
| 21 | + |
| 22 | + - name: Build |
| 23 | + run: cmake --build build --config Release |
| 24 | + |
| 25 | + - name: Test |
| 26 | + run: ctest --test-dir build --output-on-failure -C Release |
| 27 | + |
| 28 | + cross-compile: |
| 29 | + name: Cross (${{ matrix.arch }}) |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + include: |
| 35 | + - arch: aarch64-linux |
| 36 | + toolchain: toolchains/aarch64-linux-gnu.cmake |
| 37 | + packages: gcc-aarch64-linux-gnu |
| 38 | + - arch: riscv64-linux |
| 39 | + toolchain: toolchains/riscv64-linux-gnu.cmake |
| 40 | + packages: gcc-riscv64-linux-gnu |
| 41 | + - arch: arm-cortex-m |
| 42 | + toolchain: toolchains/arm-none-eabi.cmake |
| 43 | + packages: gcc-arm-none-eabi libnewlib-arm-none-eabi |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Install cross-compiler |
| 48 | + run: | |
| 49 | + sudo apt-get update |
| 50 | + sudo apt-get install -y ${{ matrix.packages }} |
| 51 | +
|
| 52 | + - name: Configure |
| 53 | + run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_BUILD_TYPE=Release |
| 54 | + |
| 55 | + - name: Build |
| 56 | + run: cmake --build build |
| 57 | + |
| 58 | + - name: Verify artifacts |
| 59 | + run: | |
| 60 | + echo "=== Static libraries ===" |
| 61 | + find build -name "*.a" | sort |
| 62 | + LIB_COUNT=$(find build -name "*.a" | wc -l) |
| 63 | + echo "Found $LIB_COUNT libraries" |
| 64 | + if [ "$LIB_COUNT" -lt 1 ]; then |
| 65 | + echo "ERROR: No libraries produced" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | +
|
| 69 | + config-generation: |
| 70 | + name: Config Generation |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + - uses: actions/setup-python@v5 |
| 75 | + with: |
| 76 | + python-version: "3.12" |
| 77 | + - run: pip install -r requirements.txt |
| 78 | + - name: Test generate_config.py |
| 79 | + run: | |
| 80 | + cat > /tmp/test_boot.yaml << 'EOF' |
| 81 | + boot: |
| 82 | + board: stm32f4 |
| 83 | + arch: arm |
| 84 | + flash_base: "0x08000000" |
| 85 | + flash_size: 1048576 |
| 86 | + layout: |
| 87 | + stage0: { offset: "0x0", size: 16384 } |
| 88 | + stage1: { offset: "0x4000", size: 65536 } |
| 89 | + bootctl_primary: { offset: "0x14000", size: 4096 } |
| 90 | + bootctl_backup: { offset: "0x15000", size: 4096 } |
| 91 | + slot_a: { offset: "0x16000", size: 479232 } |
| 92 | + slot_b: { offset: "0x8B000", size: 479232 } |
| 93 | + policy: |
| 94 | + max_boot_attempts: 3 |
| 95 | + watchdog_timeout_ms: 5000 |
| 96 | + require_signature: true |
| 97 | + EOF |
| 98 | + python scripts/generate_config.py /tmp/test_boot.yaml /tmp/generated/ |
| 99 | + test -f /tmp/generated/eboot_generated_layout.h |
| 100 | + test -f /tmp/generated/eboot_generated_memory.ld |
| 101 | + echo "Config generation passed" |
| 102 | +
|
| 103 | + report: |
| 104 | + name: Nightly Report |
| 105 | + runs-on: ubuntu-latest |
| 106 | + needs: [native-build, cross-compile, config-generation] |
| 107 | + if: always() |
| 108 | + steps: |
| 109 | + - name: Check results |
| 110 | + run: | |
| 111 | + echo "## Nightly Regression Report — eboot" |
| 112 | + echo "Date: $(date -u '+%Y-%m-%d %H:%M UTC')" |
| 113 | + echo "" |
| 114 | + echo "| Job | Status |" |
| 115 | + echo "|---|---|" |
| 116 | + echo "| Native builds | ${{ needs.native-build.result }} |" |
| 117 | + echo "| Cross-compile | ${{ needs.cross-compile.result }} |" |
| 118 | + echo "| Config gen | ${{ needs.config-generation.result }} |" |
| 119 | + if [ "${{ needs.native-build.result }}" != "success" ] || \ |
| 120 | + [ "${{ needs.cross-compile.result }}" != "success" ] || \ |
| 121 | + [ "${{ needs.config-generation.result }}" != "success" ]; then |
| 122 | + echo "" |
| 123 | + echo "❌ REGRESSION DETECTED" |
| 124 | + exit 1 |
| 125 | + fi |
| 126 | + echo "" |
| 127 | + echo "✅ All checks passed" |
0 commit comments