name: Rust CI on: push: branches: [ main ] pull_request: branches: [ main ] jobs: format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: rustup toolchain install stable --no-self-update --profile minimal - name: Check formatting run: cargo fmt --verbose --all --check clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install a stable toolchain with clippy run: rustup toolchain install stable --no-self-update --profile minimal --component clippy - name: Lint the host API run: cargo clippy --package=imxrt-rt --tests -- -D warnings tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv7em-none-eabihf - name: Run doc tests run: cargo test --doc - name: Run automated tests run: cargo test --tests -- --include-ignored - name: Install ARM GCC run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi - name: Check binaries that are linked with GNU's ld env: CARGO_TARGET_THUMBV7EM_NONE_EABIHF_RUSTFLAGS: "-C linker=arm-none-eabi-gcc -C link-arg=-mcpu=cortex-m7 -C link-arg=-mfloat-abi=hard -C link-arg=-mfpu=fpv5-d16 -C link-arg=-nostartfiles" run: cargo test --tests -- --ignored boards: runs-on: ubuntu-latest strategy: matrix: board: [ teensy4, imxrt1010evk, imxrt1170evk-cm7 ] steps: - uses: actions/checkout@v4 - run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv7em-none-eabihf --component clippy - name: Lint the RTIC example for ${{ matrix.board }} run: cargo clippy --example=blink-rtic --target=thumbv7em-none-eabihf --features=board/${{ matrix.board }},board/rtic -- -D warnings - name: Lint the blocking example ${{ matrix.board }} run: cargo clippy --example=blink-blocking --target=thumbv7em-none-eabihf --features=board/${{ matrix.board }} -- -D warnings docs: runs-on: ubuntu-latest env: RUSTDOCFLAGS: -D warnings steps: - uses: actions/checkout@v4 - run: rustup toolchain install stable --no-self-update --profile minimal - name: Check host documentation run: cargo rustdoc --package=imxrt-rt