|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + |
| 11 | +# Cancel any currently running workflows from the same PR, branch, or |
| 12 | +# tag when a new workflow is triggered. |
| 13 | +# |
| 14 | +# https://stackoverflow.com/a/66336834 |
| 15 | +concurrency: |
| 16 | + cancel-in-progress: true |
| 17 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 18 | + |
| 19 | +jobs: |
| 20 | + # -------------------------------------------------------------------------- |
| 21 | + # Check |
| 22 | + |
| 23 | + check: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + device: [ |
| 30 | + # RISC-V devices: |
| 31 | + { soc: "esp32c2", target: "riscv32imc-unknown-none-elf" }, |
| 32 | + { soc: "esp32c3", target: "riscv32imc-unknown-none-elf" }, |
| 33 | + { soc: "esp32c6", target: "riscv32imac-unknown-none-elf" }, |
| 34 | + { soc: "esp32h2", target: "riscv32imac-unknown-none-elf" }, |
| 35 | + # Xtensa devices: |
| 36 | + { soc: "esp32", target: "xtensa-esp32-none-elf" }, |
| 37 | + { soc: "esp32s2", target: "xtensa-esp32s2-none-elf" }, |
| 38 | + { soc: "esp32s3", target: "xtensa-esp32s3-none-elf" }, |
| 39 | + ] |
| 40 | + |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v4 |
| 43 | + |
| 44 | + # Install the Rust stable toolchain for RISC-V devices: |
| 45 | + - if: ${{ startsWith(matrix.device.target, 'riscv32') }} |
| 46 | + uses: dtolnay/rust-toolchain@stable |
| 47 | + with: |
| 48 | + components: rust-src |
| 49 | + target: ${{ matrix.device.target }} |
| 50 | + # Install the Rust toolchain for Xtensa devices: |
| 51 | + - if: ${{ startsWith(matrix.device.target, 'xtensa') }} |
| 52 | + |
| 53 | + with: |
| 54 | + default: true |
| 55 | + ldproxy: false |
| 56 | + |
| 57 | + - uses: Swatinem/rust-cache@v2 |
| 58 | + |
| 59 | + # NOTE: The ESP32-C2 does *not* have the RMT peripheral |
| 60 | + - if: ${{ matrix.device.soc != 'esp32c2' }} |
| 61 | + name: Check esp-hal-smartled |
| 62 | + uses: ./.github/actions/check-package |
| 63 | + with: |
| 64 | + package: esp-hal-smartled |
| 65 | + soc: ${{ matrix.device.soc }} |
| 66 | + target: ${{ matrix.device.target }} |
0 commit comments