Board Support Package (a.k.a pin management) #318
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
| # SPDX-FileCopyrightText: 2026 Roman Valls Guimera <brainstorm@nopcode.org> | |
| # | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| espressif-targets: | |
| name: Espressif target ${{ matrix.device.soc }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: [ | |
| # RISC-V devices: | |
| { soc: "esp32c2", board: "esp32c2", target: "riscv32imc-unknown-none-elf", toolchain: "stable", buildstd: "", binlib: "--lib" }, | |
| { soc: "esp32c3", board: "esp32c3", target: "riscv32imc-unknown-none-elf", toolchain: "stable", buildstd: "", binlib: "--lib" }, | |
| { soc: "esp32c6", board: "board-esp32c6-devkitc", target: "riscv32imac-unknown-none-elf", toolchain: "stable", buildstd: "", binlib: "--bin ssh-stamp-esp32" }, | |
| { soc: "esp32c6", board: "board-esp32c6-generic", target: "riscv32imac-unknown-none-elf", toolchain: "stable", buildstd: "", binlib: "--bin ssh-stamp-esp32" }, | |
| # Xtensa devices: | |
| { soc: "esp32", board: "esp32", target: "xtensa-esp32-none-elf", toolchain: "esp", buildstd: "-Z build-std=core,alloc", binlib: "--lib" }, | |
| { soc: "esp32s2", board: "board-esp32-s2-saola", target: "xtensa-esp32s2-none-elf", toolchain: "esp", buildstd: "-Z build-std=core,alloc", binlib: "--bin ssh-stamp-esp32" }, | |
| { soc: "esp32s3", board: "esp32s3", target: "xtensa-esp32s3-none-elf", toolchain: "esp", buildstd: "-Z build-std=core,alloc", binlib: "--lib" }, | |
| ] | |
| steps: | |
| - name: Cache | |
| uses: mozilla-actions/sccache-action@v0.0.10 | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Rust toolchain for RISC-V | |
| if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.device.soc) }} | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
| toolchain: stable | |
| components: rust-src, clippy, rustfmt | |
| - name: Setup Rust toolchain for Xtensa | |
| if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.device.soc) }} | |
| uses: esp-rs/xtensa-toolchain@v1.7.0 | |
| with: | |
| ldproxy: false | |
| version: 1.96.0 | |
| - name: Build project | |
| run: cargo +${{ matrix.device.toolchain }} build --release --target ${{ matrix.device.target }} -p ssh-stamp-esp32 ${{ matrix.device.binlib }} --no-default-features --features ${{ matrix.device.board }} ${{ matrix.device.buildstd }} | |
| - name: Check lints and format | |
| if: ${{ matrix.device.board == 'board-esp32c6-devkitc' }} | |
| run: | | |
| cargo +${{ matrix.device.toolchain }} clippy --release --features board-esp32c6-devkitc --target riscv32imac-unknown-none-elf -p ssh-stamp-esp32 --bin ssh-stamp-esp32 --no-default-features -- -D warnings -A clippy::default_trait_access | |
| cargo +${{ matrix.device.toolchain }} fmt -- --check | |
| packer: | |
| name: OTA Packer | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Stable Rust Toolchain | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| target: riscv32imac-unknown-none-elf | |
| toolchain: stable | |
| - name: Build utility | |
| run: cargo build-packer | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Stable Rust Toolchain | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| target: riscv32imac-unknown-none-elf | |
| toolchain: stable | |
| - name: Build all docs | |
| run: cargo build-doc | |
| - name: Check doc warnings | |
| run: cargo build-doc 2>&1 | grep -iE "broken|warning.*link" || true |