Simulation Test #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Simulation Test | |
| on: | |
| schedule: | |
| - cron: '0 3 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| qemu-simulation: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake ninja-build gcc-arm-none-eabi qemu-system-arm | |
| - name: Cross-compile for ARM | |
| run: | | |
| cmake -B build -G Ninja \ | |
| -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm-cortex-m4.cmake \ | |
| -DCMAKE_BUILD_TYPE=MinSizeRel \ | |
| -DENI_BUILD_CLI=OFF -DENI_BUILD_FRAMEWORK=OFF -DENI_BUILD_TESTS=OFF | |
| cmake --build build | |
| - name: QEMU smoke test (real run with timeout) | |
| run: | | |
| set -e | |
| # Find a built ELF image to run under QEMU | |
| ELF=$(find build -name "*.elf" -type f | head -1) | |
| if [ -z "$ELF" ]; then | |
| echo "::warning::No .elf produced; falling back to artifact inventory check" | |
| find build -name "*.a" -o -name "*.o" | head -20 | |
| exit 0 | |
| fi | |
| echo "Running $ELF under qemu-system-arm (15s timeout)..." | |
| timeout --preserve-status 15s qemu-system-arm \ | |
| -M lm3s6965evb -nographic -no-reboot \ | |
| -semihosting -kernel "$ELF" \ | |
| -monitor none -d guest_errors \ | |
| -append "test" 2>&1 | tee qemu.log || true | |
| echo "=== Last 40 lines of QEMU output ===" | |
| tail -n 40 qemu.log || true |