Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 143 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,159 @@ on:
pull_request:
merge_group:
workflow_dispatch:
schedule:
# Run every night at 8am UTC
- cron: '0 8 * * SAT'

name: cortex-m CI

jobs:
ci-linux:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
# Test cortex-m
cortex-m-ci-linux:
runs-on: ubuntu-26.04
continue-on-error: true
strategy:
matrix:
# All generated code should be running on stable now
rust: [stable]
test_cortex_m_types: [true]
rust: [nightly, stable, 1.85.0]
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --all --exclude cortex-m-rt --features cortex-m/critical-section-single-core

include:
# Test MSRV
- rust: 1.85.0
# On x86_64-unknown-linux-gnu we can run our special testing shell script
cortex-m-rt-ci-linux:
runs-on: ubuntu-26.04
continue-on-error: true
strategy:
matrix:
rust: [nightly, stable, 1.85.0]
defaults:
run:
working-directory: cortex-m-rt
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv8m.base-none-eabi,thumbv8m.main-none-eabi,thumbv8m.main-none-eabihf
- name: Install qemu and gcc
run: sudo apt-get update && sudo apt-get install qemu-system-arm gcc-arm-none-eabi
- name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }}
run: TARGET=x86_64-unknown-linux-gnu CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv6m-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv6m-none-eabi CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7m-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv7m-none-eabi CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7em-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv7em-none-eabi CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7em-none-eabihf under ${{ matrix.rust }}
run: TARGET=thumbv7em-none-eabihf CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.base-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv8m.base-none-eabi CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.main-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv8m.main-none-eabi CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.main-none-eabihf under ${{ matrix.rust }}
run: TARGET=thumbv8m.main-none-eabihf CI_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh

# Test nightly but don't fail
- rust: nightly
experimental: true
# On macOS and Windows, we at least make sure that all examples build and link.
cortex-m-rt-ci-other-os:
strategy:
matrix:
os: [macOS-latest, windows-latest]
rust: [nightly, stable, 1.85.0]
runs-on: ${{ matrix.os }}
continue-on-error: true
defaults:
run:
working-directory: cortex-m-rt
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --all --exclude cortex-m-rt --exclude testsuite --features cortex-m/critical-section-single-core
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv8m.base-none-eabi,thumbv8m.main-none-eabi,thumbv8m.main-none-eabihf
- name: Remove examples that pass by failing
run: rm examples/data_overflow.rs
- name: Build examples for thumbv6m-none-eabi
run: cargo build --target=thumbv6m-none-eabi --examples
- name: Build examples for thumbv7m-none-eabi
run: cargo build --target=thumbv7m-none-eabi --examples
- name: Build examples for thumbv7em-none-eabi
run: cargo build --target=thumbv7em-none-eabi --examples
- name: Build examples for thumbv7em-none-eabihf
run: cargo build --target=thumbv7em-none-eabihf --examples
- name: Build examples for thumbv8m.base-none-eabi
run: cargo build --target=thumbv8m.base-none-eabi --examples
- name: Build examples for thumbv8m.main-none-eabi
run: cargo build --target=thumbv8m.main-none-eabi --examples
- name: Build examples for thumbv8m.main-none-eabihf
run: cargo build --target=thumbv8m.main-none-eabihf --examples
- name: Build crate for host OS
run: cargo build

# Run examples in QEMU
cortex-m-testsuite:
runs-on: ubuntu-26.04
continue-on-error: true
strategy:
matrix:
rust: [nightly, stable, 1.85.0]
steps:
- uses: actions/checkout@v7
- name: Install qemu-run
uses: taiki-e/cache-cargo-install-action@v3
with:
tool: qemu-run
- name: Install qemu
run: sudo apt-get update && sudo apt-get install qemu-system-arm
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv8m.base-none-eabi,thumbv8m.main-none-eabi,thumbv8m.main-none-eabihf
- name: Run testsuite for thumbv8m.main-none-eabihf
run: |
cd testsuite && cargo test --features qemu --target thumbv8m.main-none-eabihf
- name: Run testsuite for thumbv8m.main-none-eabi
run: |
cd testsuite && cargo test --features qemu --target thumbv8m.main-none-eabi
- name: Run testsuite for thumbv8m.base-none-eabi
run: |
cd testsuite && cargo test --features qemu --target thumbv8m.base-none-eabi
- name: Run testsuite for thumbv7em-none-eabi
run: |
cd testsuite && cargo test --features qemu --target thumbv7em-none-eabi
- name: Run testsuite for thumbv7em-none-eabihf
run: |
cd testsuite && cargo test --features qemu --target thumbv7em-none-eabihf
- name: Run testsuite for thumbv7m-none-eabi
run: |
cd testsuite && cargo test --features qemu --target thumbv7m-none-eabi
- name: Run testsuite for thumbv6m-none-eabi
run: |
cd testsuite && cargo test --features qemu --target thumbv6m-none-eabi

report-issues:
runs-on: ubuntu-26.04
if: always()
needs: [cortex-m-ci-linux, cortex-m-rt-ci-other-os, cortex-m-rt-ci-linux, cortex-m-testsuite]
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")'
- uses: imjohnbo/issue-bot@v3
if: failure() && github.event_name == 'schedule'
with:
title: CI Failure
labels: ci
body: |
Scheduled CI run failed. Details:

https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 28 additions & 5 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,41 @@ on:
merge_group:
workflow_dispatch:

name: Clippy check
name: Clippy

jobs:
clippy:
runs-on: ubuntu-latest
clippy-host:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.85
with:
components: clippy
- run: cargo clippy --all --features cortex-m/critical-section-single-core -- -D warnings
clippy-target:
runs-on: ubuntu-26.04
continue-on-error: true
strategy:
matrix:
target:
- thumbv6m-none-eabi
- thumbv7m-none-eabi
- thumbv7em-none-eabi
- thumbv7em-none-eabihf
- thumbv8m.base-none-eabi
- thumbv8m.main-none-eabi
- thumbv8m.main-none-eabihf
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.85
with:
components: clippy
targets: thumbv7em-none-eabihf
- run: cd testsuite && cargo clippy --features qemu -- -D warnings
targets: ${{ matrix.target }}
- run: cd cortex-m && cargo clippy --target ${{ matrix.target }} --features critical-section-single-core -- -D warnings
- run: cd cortex-m-rt && cargo clippy --target ${{ matrix.target }} -- -D warnings
- run: cd testsuite && cargo clippy --target ${{ matrix.target }} --features qemu -- -D warnings
- run: cd testsuite && cargo clippy --target ${{ matrix.target }} --features hardware -- -D warnings
- run: cd cortex-m-semihosting && cargo clippy --target ${{ matrix.target }} -- -D warnings
- run: cd panic-semihosting && cargo clippy --target ${{ matrix.target }} -- -D warnings
- if: ${{ matrix.target != 'thumbv6m-none-eabi' && matrix.target != 'thumbv8m.base-none-eabi' }}
run: cd panic-itm && cargo clippy --target ${{ matrix.target }} -- -D warnings
68 changes: 0 additions & 68 deletions .github/workflows/cron.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/on-target.yml

This file was deleted.

Loading
Loading