Simplify rust_toolchain.toml
#17
Workflow file for this run
This file contains 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: | |
push: | |
paths-ignore: | |
- "**/README.md" | |
pull_request: | |
paths-ignore: | |
- "**/README.md" | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SSID: "" | |
PASSWORD: "" | |
# 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: | |
verify: | |
name: "${{ matrix.chip }} | ${{ matrix.options }}" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
chip: [ | |
"esp32", | |
"esp32c2", | |
"esp32c3", | |
"esp32c6", | |
"esp32h2", | |
"esp32s2", | |
"esp32s3", | |
] | |
options: [ | |
"", | |
"-o alloc", | |
"-o wifi -o alloc", | |
"-o ble -o alloc", | |
"-o embassy", | |
"-o probe-rs", | |
"-o stack-protector" | |
] | |
# Exclude some combinations that are not supported | |
exclude: | |
- chip: "esp32h2" | |
options: "-o wifi -o alloc" | |
- chip: "esp32s2" | |
options: "-o ble -o alloc" | |
steps: | |
- uses: actions/checkout@v4 | |
# Rust toolchain for Xtensa: | |
- if: matrix.chip == 'esp32' || matrix.chip == 'esp32s2' || matrix.chip == 'esp32s3' | |
uses: esp-rs/[email protected] | |
with: | |
default: true | |
buildtargets: ${{ matrix.chip }} | |
ldproxy: false | |
# Rust toolchain for RISC-V: | |
- if: matrix.chip != 'esp32' && matrix.chip != 'esp32s2' && matrix.chip != 'esp32s3' | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
components: clippy,rustfmt,rust-src | |
# Rust toolchain for RISC-V: | |
- if: matrix.chip != 'esp32' && matrix.chip != 'esp32s2' && matrix.chip != 'esp32s3' && matrix.options == '-o stack-protector' | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
components: clippy,rustfmt,rust-src | |
- uses: Swatinem/rust-cache@v2 | |
- name: Generate project | |
run: cargo run --release -- --chip ${{ matrix.chip }} --headless ${{ matrix.options }} test | |
- name: Build and check the project | |
working-directory: test | |
run: | | |
cargo fmt -- --check | |
cargo clippy --no-deps -- -Dwarnings | |
cargo build --release |