QEMU tests #157
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: QEMU tests | |
| on: | |
| merge_group: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "*.md" | |
| - "typos.toml" | |
| pull_request: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "*.md" | |
| - "typos.toml" | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "**/*.md" | |
| - "*.md" | |
| - "typos.toml" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| testexamples: | |
| name: QEMU run | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| toolchain: [stable] | |
| target-qemu: | |
| - target: riscv32i-unknown-none-elf | |
| qemu: riscv32 | |
| - target: riscv32im-unknown-none-elf | |
| qemu: riscv32 | |
| - target: riscv32imc-unknown-none-elf | |
| qemu: riscv32 | |
| - target: riscv32imac-unknown-none-elf | |
| qemu: riscv32 | |
| - target: riscv32imafc-unknown-none-elf | |
| qemu: riscv32 | |
| - target: riscv64imac-unknown-none-elf | |
| qemu: riscv64 | |
| - target: riscv64gc-unknown-none-elf | |
| qemu: riscv64 | |
| example-features: | |
| - example: qemu_uart | |
| features: "" | |
| - example: qemu_semihosting | |
| features: "" | |
| - example: qemu_uart | |
| features: "s-mode" | |
| - example: multi_hart | |
| features: "multi-hart" | |
| exclude: | |
| # multi_hart requires atomics extension ('a'), exclude targets without it | |
| - example-features: | |
| example: multi_hart | |
| target-qemu: | |
| target: riscv32i-unknown-none-elf | |
| - example-features: | |
| example: multi_hart | |
| target-qemu: | |
| target: riscv32im-unknown-none-elf | |
| - example-features: | |
| example: multi_hart | |
| target-qemu: | |
| target: riscv32imc-unknown-none-elf | |
| # s-mode on riscv32 requires OpenSBI which has issues with some targets | |
| - example-features: | |
| features: "s-mode" | |
| target-qemu: | |
| qemu: riscv32 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure Rust target ${{ matrix.target-qemu.target }} | |
| run: | | |
| rustup toolchain install ${{ matrix.toolchain }} | |
| rustup default ${{ matrix.toolchain }} | |
| rustup target add ${{ matrix.target-qemu.target }} | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install QEMU | |
| run: | | |
| sudo apt update | |
| sudo apt install -y qemu-system-${{ matrix.target-qemu.qemu }} | |
| - name: Run-pass tests | |
| run: | | |
| if [ -n "${{ matrix.example-features.features }}" ]; then | |
| cargo run --package xtask -- qemu --target ${{ matrix.target-qemu.target }} --example ${{ matrix.example-features.example }} --features ${{ matrix.example-features.features }} | |
| else | |
| cargo run --package xtask -- qemu --target ${{ matrix.target-qemu.target }} --example ${{ matrix.example-features.example }} | |
| fi |