Skip to content

fmt

fmt #27

Workflow file for this run

name: CI
on:
pull_request:
push:
merge_group:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSRV: "1.80.0"
# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.
#
# https://stackoverflow.com/a/66336834
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
# --------------------------------------------------------------------------
# Build Packages
rusty-robot:
name: rusty-robot (${{ matrix.device.soc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
device: [
#Local
#{ soc: "local", target: "x86_64-unknown-linux-gnu", toolchain: "stable" }
#RPi Boards
#{ soc: "rp2040", target: "thumbv6m-none-eabi", toolchain: "stable" }
#Esp32 boards
## Xtensa devices:
{ soc: "esp32", target: "xtensa-esp32-none-elf", toolchain: "esp" }
]
steps:
- uses: actions/checkout@v4
# Install the Rust toolchain for Xtensa devices:
- uses: esp-rs/xtensa-toolchain@v1.5
with:
ldproxy: false
# Install the Rust stable toolchain for RISC-V devices:
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: stable
components: rust-src
# Cache Cargo builds
- uses: Swatinem/rust-cache@v2
# Build the project with cargo xtask
- name: Build and Check
uses: ./.github/actions/check-rusty-robot
with:
device: ${{ matrix.device.soc }}
target: ${{ matrix.device.target }}
toolchain: ${{ matrix.device.toolchain }}
# --------------------------------------------------------------------------
# MSRV
msrv:
runs-on: ubuntu-latest
env:
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@v4
- uses: esp-rs/xtensa-toolchain@v1.5
with:
ldproxy: false
version: ${{ env.MSRV }}
- uses: Swatinem/rust-cache@v2
# Verify the MSRV for all Xtensa chips:
- name: msrv Xtensa
run: |
cargo xtask build-package esp32 --toolchain=esp --target=xtensa-esp32-none-elf
# --------------------------------------------------------------------------
# Format
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Some of the configuration items in 'rustfmt.toml' require the 'nightly'
# release channel:
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- uses: Swatinem/rust-cache@v2
# Check the formatting of all packages:
- run: cargo xtask fmt-packages --check