feat(example): Add RP2040-Zero example with EPD #506
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| typos: | |
| name: Check for typos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: crate-ci/typos@master | |
| markdown: | |
| name: Check Markdown | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: DavidAnson/markdownlint-cli2-action@v23 | |
| with: | |
| globs: "**/*.md,#CHANGELOG.md" | |
| separator: "," | |
| fmt: | |
| name: Run fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --check --all | |
| clippy: | |
| name: Run clippy (${{ matrix.project.name }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: | |
| # Core no_std workspace (default host build) | |
| - name: workspace | |
| dir: . | |
| target: "" | |
| setup_xtensa: false | |
| # ESP-IDF demo using Xtensa toolchain | |
| - name: esp32-std-demo | |
| dir: examples/esp32-std-demo | |
| target: xtensa-esp32-espidf | |
| setup_xtensa: true | |
| # no-std demo | |
| - name: esp32-no-std-demo | |
| dir: examples/esp32-no-std-demo | |
| target: "" | |
| setup_xtensa: true | |
| # EPD Waveshare demo | |
| - name: epd-waveshare-demo | |
| dir: examples/epd-waveshare-demo | |
| target: "" | |
| setup_xtensa: true | |
| # STM32-Nucleo OLED Demo | |
| - name: stm32-nucleo-oled-example | |
| dir: examples/stm32-nucleo-oled-example | |
| target: "thumbv7em-none-eabihf" | |
| setup_xtensa: false | |
| # Lilygo-epd47 demo | |
| - name: lilygo-epd47-demo | |
| dir: examples/lilygo-epd47-demo | |
| target: "" | |
| setup_xtensa: true | |
| # RP2040-Zero EPD demo | |
| # Run from its own dir so .cargo/config.toml supplies | |
| # build-std = ["core", "alloc"], required for thumbv6m-none-eabi. | |
| # kasuari (via ratatui) uses alloc::sync + fetch_add which are | |
| # unavailable on thumbv6m without build-std. | |
| - name: rp2040-1in54-epd-example | |
| dir: examples/rp2040-1in54-epd-example | |
| target: "thumbv6m-none-eabi" | |
| setup_xtensa: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Rust (stable) | |
| if: ${{ matrix.project.setup_xtensa == false }} | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rust-src | |
| - name: Setup Xtensa toolchain (ESP-IDF) | |
| if: ${{ matrix.project.setup_xtensa == true }} | |
| uses: esp-rs/xtensa-toolchain@v1.6.0 | |
| with: | |
| default: true | |
| buildtargets: esp32 | |
| ldproxy: true | |
| - name: Setup target | |
| if: ${{ matrix.project.target != '' && matrix.project.setup_xtensa == false }} | |
| run: rustup target add ${{ matrix.project.target }} | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run Clippy | |
| working-directory: ${{ matrix.project.dir }} | |
| run: | | |
| if [ -n "${{ matrix.project.target }}" ]; then | |
| cargo clippy --target "${{ matrix.project.target }}" -- -D warnings | |
| else | |
| cargo clippy -- -D warnings | |
| fi | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Run tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run lib tests | |
| run: cargo test --locked --lib --all-features | |
| - name: Run doctests | |
| run: cargo test --locked -p mousefood --doc | |
| build-no-std: | |
| name: build [no-std] ${{ matrix.target }} ${{ matrix.toolchain }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - arm-unknown-linux-gnueabi | |
| - armv7-unknown-linux-gnueabihf | |
| - x86_64-unknown-linux-gnu | |
| - x86_64-unknown-linux-musl | |
| - thumbv7em-none-eabi | |
| - thumbv7em-none-eabihf | |
| - thumbv7m-none-eabi | |
| # no alloc::sync, required by kasuari | |
| # - thumbv6m-none-eabi | |
| # - riscv32imc-unknown-none-elf # esp32c2, esp32c3 | |
| # - riscv32imac-unknown-none-elf # esp32c6, esp32h2 | |
| toolchain: ["1.86.0", "stable"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| target: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo build --release --target ${{ matrix.target }} | |
| # thumbv6m-none-eabi is validated by building the rp2040 example from its | |
| # own directory. Its .cargo/config.toml already provides: | |
| # build-std = ["core", "alloc"] | |
| # build-std-features = ["panic_immediate_abort"] | |
| # and the example uses portable-atomic + rp2040-hal's critical-section-impl | |
| # to provide software atomics, which is what makes kasuari compile correctly | |
| # on this target. This is the only supported approach for thumbv6m. | |
| build-rp2040: | |
| name: build [no-std] thumbv6m-none-eabi (rp2040 example) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| target: thumbv6m-none-eabi | |
| components: rust-src | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build rp2040 example | |
| working-directory: examples/rp2040-1in54-epd-example | |
| run: cargo build --release | |
| build-espidf-std: | |
| name: build [std] ${{ matrix.target }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - riscv32imc-esp-espidf # esp32c2, esp32c3 | |
| - riscv32imac-esp-espidf # esp32c6, esp32h2 | |
| - xtensa-esp32-espidf | |
| - xtensa-esp32s2-espidf | |
| - xtensa-esp32s3-espidf | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: esp-rs/xtensa-toolchain@v1.6.0 | |
| with: | |
| default: true | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo build --release --features=std --target ${{ matrix.target }} -Zbuild-std=std,panic_abort | |
| env: | |
| RUSTFLAGS: "-Zunstable-options -Cpanic=immediate-abort" |