esp32-nimble 0.12.0

A wrapper for the ESP32 NimBLE Bluetooth stack.
name: CI

on:
  push:
    paths-ignore: '**/*.md'
  pull_request:
    paths-ignore: '**/*.md'
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: riscv32imc-esp-espidf
            idf-version: v5.2.5
          - target: riscv32imc-esp-espidf
            idf-version: v5.3.2
            ble5-example: true
          - target: riscv32imc-esp-espidf
            idf-version: v5.4.3
          - target: riscv32imc-esp-espidf
            idf-version: v5.5.3
          - target: riscv32imac-esp-espidf
            idf-version: v5.2.5
            mcu: esp32c6
          - target: xtensa-esp32-espidf
            idf-version: v5.2.5
          - target: xtensa-esp32-espidf
            idf-version: v5.3.2
            ble-example: true
          - target: xtensa-esp32-espidf
            idf-version: v5.4.3
          - target: xtensa-esp32-espidf
            idf-version: v5.5.3


    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v6
        with:
          persist-credentials: false
      - name: Install Rust for Xtensa
        uses: esp-rs/xtensa-toolchain@v1.6
        with:
          default: true
          ldproxy: true
      - name: Setup | MCU
        if: ${{ matrix.mcu }}
        run: echo "MCU=${{ matrix.mcu }}" >> "$GITHUB_ENV"
      - name: Setup env
        run: |
          echo "ESP_IDF_VERSION=${{ matrix.idf-version }}" >> "$GITHUB_ENV"
          echo "RUSTFLAGS=--cfg espidf_time64" >> "$GITHUB_ENV"
      - name: Fmt check
        run: cargo fmt --check
      - name: Clippy check
        run: cargo clippy --target ${{ matrix.target }} -- -D clippy::all -D warnings
      - name: Build
        run: cargo build --target ${{ matrix.target }}
      - name: Build | no_std
        run: cargo build --target ${{ matrix.target }} --no-default-features --features no_std
      - name: Build | Examples
        if: matrix.ble-example
        run: cargo build --target ${{ matrix.target }} --example ble_*
      - name: Build | Examples(ble5)
        if: matrix.ble5-example
        run: cargo build --target ${{ matrix.target }} --example ble5_*