CI: Improve workflow #3
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| board: [discoveryf4, discoveryf429, netduinoplus2] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install ARM toolchain | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: '15.2.Rel1' | |
| - name: Configure for ${{ matrix.board }} | |
| run: make ${{ matrix.board }}_defconfig | |
| - name: Build kernel | |
| run: make | |
| - name: Show binary size | |
| run: arm-none-eabi-size build/${{ matrix.board }}/f9.elf | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: f9-${{ matrix.board }} | |
| path: | | |
| build/${{ matrix.board }}/f9.elf | |
| build/${{ matrix.board }}/f9.bin | |
| - name: Install QEMU | |
| if: matrix.board == 'netduinoplus2' | |
| run: sudo apt-get update && sudo apt-get install -y qemu-system-arm | |
| - name: QEMU boot test | |
| if: matrix.board == 'netduinoplus2' | |
| run: | | |
| timeout 15s qemu-system-arm \ | |
| -M netduinoplus2 \ | |
| -nographic \ | |
| -serial mon:stdio \ | |
| -kernel build/netduinoplus2/f9.elf 2>&1 | tee qemu.log || true | |
| echo "=== QEMU Output ===" | |
| cat qemu.log | |
| echo "===================" | |
| if grep -q "Press '?' to print KDB menu" qemu.log; then | |
| echo "✓ KDB shell ready"; exit 0 | |
| elif grep -q "KDB" qemu.log; then | |
| echo "✓ KDB initialized"; exit 0 | |
| elif grep -q "f9\|F9" qemu.log; then | |
| echo "✓ Kernel boot detected"; exit 0 | |
| fi | |
| if grep -qE "MEMFAULT|HardFault|panic" qemu.log; then | |
| echo "✗ Kernel crash detected"; exit 1 | |
| fi | |
| echo "✗ No boot message detected (timeout or minimal output)" | |
| exit 1 |