Skip to content

Add demo app

Add demo app #266

Workflow file for this run

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@v4
- uses: crate-ci/typos@master
markdown:
name: Check Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v20
with:
globs: '**/*.md,#CHANGELOG.md'
separator: ','
fmt:
name: Run fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check --all
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
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/mousefood-esp32-std-demo
target: xtensa-esp32-espidf
setup_xtensa: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust (stable)
if: ${{ matrix.project.setup_xtensa == false }}
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Setup Xtensa toolchain (ESP-IDF)
if: ${{ matrix.project.setup_xtensa == true }}
uses: esp-rs/[email protected]
with:
default: true
buildtargets: esp32
ldproxy: true
- 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@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run lib tests
run: cargo test --locked --lib --features epd-weact
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
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.85.0", "stable" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}
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@v4
- uses: esp-rs/[email protected]
with:
default: true
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --features=std --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort