name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
CARGO_TERM_COLOR: always
DEFMT_LOG: trace
jobs:
build:
name: Build Examples
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings -C link-arg=-Tlinkall.x -C link-arg=-Tdefmt.x"
strategy:
fail-fast: false
matrix:
target: [esp32, esp32s3, esp32c6]
features: [log, defmt]
include:
- target: esp32
rust_target: xtensa-esp32-none-elf
toolchain: esp
example: i2s_parallel
cargo_unstable: "-Zbuild-std=core,alloc"
- target: esp32
rust_target: xtensa-esp32-none-elf
toolchain: +esp
example: i2s_parallel_latch
cargo_unstable: "-Zbuild-std=core,alloc"
- target: esp32s3
rust_target: xtensa-esp32s3-none-elf
toolchain: +esp
example: lcd_cam
cargo_unstable: "-Zbuild-std=core,alloc"
- target: esp32s3
rust_target: xtensa-esp32s3-none-elf
toolchain: +esp
example: lcd_cam_latch
cargo_unstable: "-Zbuild-std=core,alloc"
- target: esp32c6
rust_target: riscv32imac-unknown-none-elf
toolchain: ""
example: parl_io
cargo_unstable: ""
steps:
- uses: actions/checkout@v4
- name: Install Xtensa toolchain
uses: esp-rs/xtensa-toolchain@v1.5
with:
ldproxy: false
version: 1.86.0.0
- name: Install RISC-V toolchain
uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: stable
components: rust-src
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "ci-${{ matrix.target }}"
cache-all-crates: true
- name: Build examples
run: |
cargo ${{ matrix.toolchain }} build --target ${{ matrix.rust_target }} --example ${{ matrix.example }} --features "${{ matrix.target }},${{ matrix.features }}" ${{ matrix.cargo_unstable }}