Skip to content

Add SMP support

Add SMP support #711

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:
msrv-targets: ${{ steps.set-matrix.outputs.msrv_targets }}
stable-targets: ${{ steps.set-matrix.outputs.stable_targets }}
nightly-tier2-targets: ${{ steps.set-matrix.outputs.nightly_tier2_targets }}
nightly-tier3-targets: ${{ steps.set-matrix.outputs.nightly_tier3_targets }}
nightly-tier3-noatomic-targets: ${{ steps.set-matrix.outputs.nightly_tier3_noatomic_targets }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- id: set-matrix
run: |
just github_info >> "$GITHUB_OUTPUT"
# Build the workspace for a target architecture using the MSRV
build-tier2-msrv:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.msrv-targets) }}
action:
- build
- clippy
- doc
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install 1.93
rustup target add ${{ matrix.target }} --toolchain=1.93
- name: Run just
run: |
RUSTUP_TOOLCHAIN=1.93 just ${{ matrix.action }}-tier2 ${{ matrix.target }}
# Build the workspace for a target architecture using latest stable
build-tier2-stable:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.stable-targets) }}
action:
- build
- clippy
- doc
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install stable
rustup target add ${{ matrix.target }} --toolchain=stable
- name: Run just
run: |
RUSTUP_TOOLCHAIN=stable just ${{ matrix.action }}-tier2 ${{ matrix.target }}
# Build the workspace for all tier2 target architectures using rust-toolchain.toml
build-tier2-nightly:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.nightly-tier2-targets) }}
action:
- build
- clippy
- doc
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Run just
run: |
just ${{ matrix.action }}-tier2 ${{ matrix.target }}
# Build the workspace for all tier3 target architectures using rust-toolchain.toml
build-tier3-nightly:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.nightly-tier3-targets) }}
action:
- build
- clippy
- doc
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Run just
run: |
just ${{ matrix.action }}-tier3 ${{ matrix.target }}
# Build the workspace for all tier3 non atomic target architectures using rust-toolchain.toml
build-tier3-no-atomics:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target: ${{ fromJSON(needs.setup.outputs.nightly-tier3-noatomic-targets) }}
action:
- build
- clippy
- doc
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Run just
run: |
just ${{ matrix.action }}-tier3-no-atomics ${{ matrix.target }}
# Build the host-only stuff on stable and MSRV
build-arm-targets:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust:
- 1.93
- stable
- ""
action:
- build
- clippy
- doc
exclude:
- rust: 1.93
action: clippy
- rust: stable
action: clippy
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Install Rust
run: |
rustup install ${{ matrix.rust }}
- name: Run just
run: |
RUSTUP_TOOLCHAIN=${{ matrix.rust }} just ${{ matrix.action }}-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-msrv
- build-tier2-stable
- build-tier2-nightly
- build-tier3-nightly
- build-tier3-no-atomics
- build-arm-targets
steps:
- run: /bin/true
# Format the workspace
fmt-check:
runs-on: ubuntu-24.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Run just
run: |
just fmt-check
# Run clippy on the examples
clippy-examples:
runs-on: ubuntu-24.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Install GCC and libclang1
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi libclang1
- name: Run just
run: |
just clippy-examples
# Run the unit tests
test-cargo:
runs-on: ubuntu-24.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Just
uses: taiki-e/install-action@just
- name: Run just
run: |
just test-cargo
# Run some programs in QEMU 9
test-qemu:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
recipe:
- test-qemu-v4t
- test-qemu-v5te
- test-qemu-v6
- test-qemu-v7r
- test-qemu-v7a
- test-qemu-v8r
- test-qemu-v8r-el2
steps:
- name: Checkout
uses: actions/checkout@v7
- 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 gcc-arm-none-eabi libclang1
- 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 ${{ matrix.recipe }}
# Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail
all:
runs-on: ubuntu-24.04
if: always()
# not gating on clippy-all
needs:
- build-all
- fmt-check
- test-cargo
- test-qemu
timeout-minutes: 2
steps:
- name: Ensure all required jobs succeed
run: |
echo "Our needs:"
echo '${{ toJSON(needs) }}'
echo "Checking..."
echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'