Add multicore example #113
Workflow file for this run
This file contains 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
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
name: Build | |
jobs: | |
# Define Rust versions dynamically | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.rust_versions }} | |
steps: | |
- id: set-matrix | |
run: | | |
echo 'rust_versions={"rust": ["stable", "1.82"]}' >> "$GITHUB_OUTPUT" | |
# Build the workspace for a target architecture | |
build: | |
runs-on: ubuntu-24.04 | |
needs: setup | |
strategy: | |
matrix: | |
rust: ${{ fromJSON(needs.setup.outputs.matrix).rust }} | |
target: | |
- armebv7r-none-eabi | |
- armebv7r-none-eabihf | |
- 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 }} --no-default-features | |
build-versatileab: | |
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 target add armv7a-none-eabi | |
rustup target add armv7r-none-eabi | |
rustup target add armv7r-none-eabihf | |
- name: Build | |
run: | | |
cargo build --manifest-path ./examples/versatileab/Cargo.toml --target armv7a-none-eabi | |
cargo build --manifest-path ./examples/versatileab/Cargo.toml --target armv7r-none-eabi | |
cargo build --manifest-path ./examples/versatileab/Cargo.toml --target armv7r-none-eabihf | |
build-mps3-an536: | |
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 nightly | |
rustup default nightly | |
rustup component add rust-src --toolchain nightly | |
- name: Build | |
run: | | |
cargo build --manifest-path ./examples/mps3-an536/Cargo.toml --target armv8r-none-eabihf -Zbuild-std=core | |
# 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 | |
# Build the workspace for the target architecture but using nightly to compile libcore | |
# Technically it doens't need 'setup' but it makes the graph look nicer | |
build-tier3: | |
runs-on: ubuntu-24.04 | |
needs: setup | |
strategy: | |
matrix: | |
target: | |
- armebv7r-none-eabi | |
- armebv7r-none-eabihf | |
- armv7r-none-eabi | |
- armv7a-none-eabi | |
- armv7a-none-eabihf | |
- armv7r-none-eabihf | |
- armv8r-none-eabihf | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust | |
run: | | |
rustup install nightly | |
rustup default nightly | |
rustup component add rust-src --toolchain nightly | |
- name: Build | |
run: | | |
cargo build --target ${{ matrix.target }} -Zbuild-std=core | |
cargo build --target ${{ matrix.target }} -Zbuild-std=core --no-default-features | |
# 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, build-tier3, build-host, build-versatileab, build-mps3-an536] | |
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 | |
- armebv7r-none-eabi | |
- armebv7r-none-eabihf | |
- 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 }} --no-default-features | |
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 | |
- 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 | |
- 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: | |
- armebv7r-none-eabi | |
- armebv7r-none-eabihf | |
- 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 cortex-ar/Cargo.toml | |
# Run some programs in QEMU 8 on Linux (but not MPS3-AN536 examples) | |
qemu-test-linux: | |
runs-on: ubuntu-24.04 | |
needs: [build-all] | |
steps: | |
- name: Install QEMU | |
run: sudo apt-get -y update && sudo apt-get -y install qemu-system-arm | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run tests in QEMU | |
run: ./tests.sh | |
# Run some programs in QEMU 9 on Windows (including MPS3-AN536 examples) | |
qemu-test-windows: | |
runs-on: windows-latest | |
needs: [build-all] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install QEMU | |
run: choco install qemu | |
- name: Run tests in QEMU | |
shell: bash | |
run: PATH=${PATH}:/c/Program\ Files/qemu ./tests.sh | |
# Gather all the above qemu jobs together for the purposes of getting an overall pass-fail | |
qemu-test-all: | |
runs-on: ubuntu-24.04 | |
needs: [qemu-test-linux, qemu-test-windows] | |
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, qemu-test-all] # not gating on clippy-all | |
steps: | |
- run: /bin/true |