|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: boots under real OpenSBI |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + timeout-minutes: 40 |
| 14 | + env: |
| 15 | + MCPP_VERSION: 2026.8.20.2 |
| 16 | + XLINGS_VERSION: v2026.8.17.2 |
| 17 | + XLINGS_NON_INTERACTIVE: '1' |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Install xlings |
| 22 | + run: | |
| 23 | + curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ |
| 24 | + | bash -s "$XLINGS_VERSION" |
| 25 | + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" |
| 26 | +
|
| 27 | + - name: Install mcpp |
| 28 | + run: | |
| 29 | + xlings update |
| 30 | + xlings install "mcpp@$MCPP_VERSION" -y -g |
| 31 | + mcpp --version |
| 32 | + mcpp self config --mirror GLOBAL |
| 33 | +
|
| 34 | + - name: Install the emulator |
| 35 | + run: | |
| 36 | + # Both homes: the shim on PATH dispatches against whichever home owns |
| 37 | + # it, while mcpp starts the runner through its own. |
| 38 | + xlings install xim:qemu-riscv -y |
| 39 | + XLINGS_HOME="$HOME/.mcpp/registry" xlings install xim:qemu-riscv -y |
| 40 | +
|
| 41 | + # ⚠️ The assertion is on the OUTPUT, not on the exit status. A firmware |
| 42 | + # that never reaches the payload exits zero, and so does a payload whose |
| 43 | + # console writes go nowhere — which is precisely the failure this backend |
| 44 | + # exists to avoid on a second machine. |
| 45 | + - name: The example prints under `-bios default` |
| 46 | + run: | |
| 47 | + set -euo pipefail |
| 48 | + cd examples/hello |
| 49 | + Q=$(ls -d "$HOME"/.mcpp/registry/data/xpkgs/xim-x-qemu-riscv/*/bin/qemu-system-riscv64 | head -1) |
| 50 | + sed -i "s|\"qemu-system-riscv64\"|\"$Q\"|" mcpp.toml |
| 51 | + mcpp run 2>&1 | tee run.log |
| 52 | + grep -q "hello from openkal over SBI" run.log |
| 53 | + grep -q "heap ok" run.log |
0 commit comments