Skip to content

Go go gadget releases #345

Go go gadget releases

Go go gadget releases #345

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:
matrix: ${{ steps.set-matrix.outputs.rust_versions }}
steps:
- id: set-matrix
run: |
echo 'rust_versions={"rust": ["stable", "1.83"]}' >> "$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.matrix).rust }}
target:
- armv7r-none-eabi
- armv7r-none-eabihf
- armv7a-none-eabi
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
run: |
cargo build --target ${{ matrix.target }}
cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-multi-core, check-asm"
cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-single-core, check-asm"
# These targets are in nightly and coming to stable soon
build-tier2-nightly:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
target:
- armv7a-none-eabi
- armv7a-none-eabihf
- armv7r-none-eabi
- armv7r-none-eabihf
- armv8r-none-eabihf
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install nightly-2025-10-29
rustup target add ${{ matrix.target }} --toolchain nightly-2025-10-29
- name: Build
run: |
cargo +nightly-2025-10-29 build --target ${{ matrix.target }}
cargo +nightly-2025-10-29 build --target ${{ matrix.target }} --features "serde, defmt, critical-section-multi-core, check-asm"
cargo +nightly-2025-10-29 build --target ${{ matrix.target }} --features "serde, defmt, critical-section-single-core, check-asm"
# These targets need build-std, and have no atomics so cannot build the critical-section module
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 rust
run: |
rustup install nightly-2025-10-29
rustup component add rust-src --toolchain nightly-2025-10-29
- name: Build
run: |
cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core
cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core --features "serde, defmt, check-asm"
# Build the host tools
build-host:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: [stable, 1.59]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build
run: |
cd arm-targets
cargo build
cargo test
# 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-tier2-nightly, build-tier3-no-atomics, build-host]
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.matrix).rust }}
target:
- armv7a-none-eabi
- armv7r-none-eabi
- armv7r-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.matrix).rust }}
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:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install stable
rustup default stable
rustup component add rustfmt
- name: Format
run: |
cargo fmt --check
# Format the host tools
fmt-host:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install stable
rustup default stable
rustup component add rustfmt
- name: Format
run: |
cd arm-targets
cargo fmt --check
# Gather all the above fmt jobs together for the purposes of getting an overall pass-fail
fmt-all:
runs-on: ubuntu-24.04
needs: [fmt, fmt-host]
steps:
- run: /bin/true
# Run clippy on the workpace
clippy:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.matrix).rust }}
target:
- armv7r-none-eabi
- armv7r-none-eabihf
- armv7a-none-eabi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
rustup component add clippy
- name: Clippy
run: |
cargo clippy --target ${{ matrix.target }}
cargo clippy --target ${{ matrix.target }} --no-default-features
cargo clippy --target ${{ matrix.target }} --all-features
# Run clippy on the host tools
clippy-host:
runs-on: ubuntu-24.04
needs: setup
strategy:
matrix:
rust: ${{ fromJSON(needs.setup.outputs.matrix).rust }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add clippy
- name: Clippy
run: |
cd arm-targets
cargo clippy
# 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-host]
steps:
- run: /bin/true
# Run the unit tests
unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup install stable
rustup default stable
- name: Run cargo test
run: |
cargo test --manifest-path aarch32-cpu/Cargo.toml
# Run some programs in QEMU 9
# These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets
qemu-test:
runs-on: ubuntu-24.04
needs: [build-all]
steps:
- name: Checkout
uses: actions/checkout@v4
- 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
./tests.sh
# 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, qemu-test] # not gating on clippy-all
steps:
- run: /bin/true