Skip to content

Add Hypervisor calls #475

Add Hypervisor calls

Add Hypervisor calls #475

Workflow file for this run

on:
pull_request:
merge_group:
name: Build
jobs:
# Define Rust versions dynamically. Test stable and MSRV.
setup:
runs-on: ubuntu-latest
outputs:
rust-versions: ${{ steps.set-matrix.outputs.rust_versions }}
stable-targets: ${{ steps.set-matrix.outputs.stable_targets }}
steps:
- id: set-matrix
run: |
echo 'rust_versions=["stable", "1.83"]' >> "$GITHUB_OUTPUT"
echo 'stable_targets=["armv7a-none-eabi","armv7a-none-eabihf","armv7r-none-eabi","armv7r-none-eabihf","armv8r-none-eabihf"]' >> "$GITHUB_OUTPUT"
# Build the workspace for a target architecture
build-tier2:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }}
target: ${{ fromJSON(needs.setup.outputs.stable-targets) }}
exclude:
- rust: 1.83
target: armv7a-none-eabihf
- rust: 1.83
target: armv8r-none-eabihf
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
- name: Build
run: |
just build-tier2 ${{ matrix.target }}
# These targets need build-std
build-tier3:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target:
- thumbv7r-none-eabi
- thumbv7r-none-eabihf
- thumbv7a-none-eabi
- thumbv7a-none-eabihf
- thumbv8r-none-eabihf
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install nightly-2026-01-26
rustup component add rust-src --toolchain nightly-2026-01-26
rustup default nightly-2026-01-26
- name: Build
run: |
just build-tier3 ${{ matrix.target }}
# These targets need build-std, and have no atomics so we have to skip
# the 'critical-section-multi-core' feature
build-tier3-no-atomics:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target:
- armv4t-none-eabi
- thumbv4t-none-eabi
- armv5te-none-eabi
- thumbv5te-none-eabi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install nightly-2026-01-26
rustup component add rust-src --toolchain nightly-2026-01-26
rustup default nightly-2026-01-26
- name: Build
run: |
just build-tier3-no-atomics ${{ matrix.target }}
# Build the host-only stuff
build-arm-targets:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build
run: |
just build-arm-targets
# Gather all the above build jobs together for the purposes of getting an overall pass-fail
build-all:
runs-on: ubuntu-24.04
needs: [build-tier2, build-tier3-no-atomics, build-tier3, build-arm-targets]
steps:
- run: /bin/true
# Build the docs for the workspace
docs:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }}
target: ${{ fromJSON(needs.setup.outputs.stable-targets) }}
exclude:
- rust: 1.83
target: armv7a-none-eabihf
- rust: 1.83
target: armv8r-none-eabihf
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
- name: Build docs
run: |
cargo doc --target ${{ matrix.target }}
cargo doc --target ${{ matrix.target }} --all-features
# Build the docs for the host tools
docs-host:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build docs
run: |
cd arm-targets
cargo doc
# Gather all the above doc jobs together for the purposes of getting an overall pass-fail
docs-all:
runs-on: ubuntu-24.04
needs: [docs, docs-host]
steps:
- run: /bin/true
# Format the workspace
fmt-all:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install stable
rustup default stable
rustup component add rustfmt
- name: Format
run: |
just fmt-check
# Run clippy on the workpace
clippy:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.stable-targets) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup toolchain install 1.92
rustup default 1.92
rustup target add ${{ matrix.target }}
rustup component add clippy
- name: Clippy
run: |
just clippy-target ${{ matrix.target }}
# Run clippy on the examples
clippy-examples:
runs-on: ubuntu-24.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup toolchain install 1.92
rustup default 1.92
rustup target add armv7r-none-eabihf
rustup target add armv8r-none-eabihf
rustup component add clippy
- name: Clippy
run: |
just clippy-examples
# Run clippy on the host tools
clippy-host:
runs-on: ubuntu-24.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup toolchain install 1.92
rustup default 1.92
rustup component add clippy
- name: Clippy
run: |
just clippy-host
# Gather all the above clippy jobs together for the purposes of getting an overall pass-fail
clippy-all:
runs-on: ubuntu-24.04
needs: [clippy, clippy-examples, clippy-host]
steps:
- run: /bin/true
# Run the unit tests
unit-test-all:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install stable
rustup default stable
- run: |
just test-cargo
# Run some programs in QEMU 9 for Armv4T
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v4t:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v4t
# Run some programs in QEMU 9 for Armv4T
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v5te:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v5te
# Run some programs in QEMU 9 for Armv6
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v6:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v6
# Run some programs in QEMU 9 for Armv7-A
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v7a:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v7a
# Run some programs in QEMU 9 for Armv7-R
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v7r:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v7r
# Run some programs in QEMU 9 for Armv8-R
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
test-qemu-v8r:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libpixman-1-0 libfdt1 libglib2.0-0t64
- name: Install custom QEMU into /opt
run: |
curl -sSL https://github.com/jonathanpallant/qemu9-for-ubuntu-2404/releases/download/qemu-9.2.3%2Bbuild0/qemu-9.2.3-ubuntu-24.04.tar.gz | sudo tar xvzf - -C /
- name: Run tests in QEMU
run: |
export PATH=/opt/qemu/bin:$PATH
just test-qemu-v8r
# Gather all the above QEMU jobs together for the purposes of getting an overall pass-fail
test-qemu-all:
runs-on: ubuntu-24.04
needs:
[
test-qemu-v4t,
test-qemu-v5te,
test-qemu-v6,
test-qemu-v7a,
test-qemu-v7r,
test-qemu-v8r,
]
steps:
- run: /bin/true
# Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail
all:
runs-on: ubuntu-24.04
needs: [docs-all, build-all, fmt-all, unit-test-all, test-qemu-all] # not gating on clippy-all
if: failure()
steps:
- run: exit 1