esp-idf-hal 0.45.2

A Hardware abstraction layer for Espressif's ESP family of microcontrollers based on the ESP-IDF framework.
name: CI

on:
  push:
    branches:
      - master
  pull_request:
  schedule:
    - cron: "50 4 * * *"
  workflow_dispatch:

env:
  rust_toolchain: nightly
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  compile:
    name: Compile
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          - riscv32imc-esp-espidf
          - riscv32imac-esp-espidf
          - xtensa-esp32-espidf
          - xtensa-esp32s2-espidf
          - xtensa-esp32s3-espidf
        idf-version:
          - release/v4.4
          - release/v5.2
          - v5.3.2
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v3

      - name: Setup | Rust
        if: matrix.target == 'riscv32imc-esp-espidf'
        uses: dtolnay/rust-toolchain@v1
        with:
          toolchain: ${{ env.rust_toolchain }}
          components: rustfmt, clippy, rust-src

      - name: Install Rust for Xtensa
        if: matrix.target != 'riscv32imc-esp-espidf'
        uses: esp-rs/xtensa-toolchain@v1.5.1
        with:
          default: true
          
      - name: Build | Fmt Check
        run: cargo fmt -- --check

      - name: Build | Clippy
        if: matrix.target != 'riscv32imac-esp-espidf' || matrix.idf-version != 'release/v4.4'
        env:
          ESP_IDF_VERSION: ${{ matrix.idf-version }}
          ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
          RUSTFLAGS: "${{ matrix.idf-version != 'release/v4.4' && '--cfg espidf_time64' || matrix.idf-version == 'release/v4.4' && '--cfg espidf_time32' }}"
        run: cargo clippy --features experimental --no-deps --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort -- -Dwarnings

      - name: Build | Compile, all
        if: matrix.target != 'riscv32imac-esp-espidf' || matrix.idf-version != 'release/v4.4'
        env:
          ESP_IDF_VERSION: ${{ matrix.idf-version }}
          ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
          RUSTFLAGS: "${{ matrix.idf-version != 'release/v4.4' && '--cfg espidf_time64' || matrix.idf-version == 'release/v4.4' && '--cfg espidf_time32' }}"
        run: cargo build --target ${{ matrix.target }} --features nightly,experimental,critical-section,embassy-sync -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort

      - name: Build | Compile, no_std
        if: matrix.target != 'riscv32imac-esp-espidf' || matrix.idf-version != 'release/v4.4'
        env:
          ESP_IDF_VERSION: ${{ matrix.idf-version }}
          ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
          RUSTFLAGS: "${{ matrix.idf-version != 'release/v4.4' && '--cfg espidf_time64' || matrix.idf-version == 'release/v4.4' && '--cfg espidf_time32' }}"
        run: cargo build --no-default-features --features experimental --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort

      - name: Build | Compile, no_std, alloc
        if: matrix.target != 'riscv32imac-esp-espidf' || matrix.idf-version != 'release/v4.4'
        env:
          ESP_IDF_VERSION: ${{ matrix.idf-version }}
          ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
          RUSTFLAGS: "${{ matrix.idf-version != 'release/v4.4' && '--cfg espidf_time64' || matrix.idf-version == 'release/v4.4' && '--cfg espidf_time32' }}"
        run: cargo build --features alloc --no-default-features --features experimental --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort

      - name: Setup | ldproxy
        if: matrix.target == 'riscv32imc-esp-espidf'
        run: |
          curl -L https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip -o $HOME/.cargo/bin/ldproxy.zip
          unzip "$HOME/.cargo/bin/ldproxy.zip" -d "$HOME/.cargo/bin/"
          chmod a+x $HOME/.cargo/bin/ldproxy

      - name: Build | Examples
        if: matrix.target != 'riscv32imac-esp-espidf' || matrix.idf-version != 'release/v4.4'
        env:
          ESP_IDF_VERSION: ${{ matrix.idf-version }}
          ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
          RUSTFLAGS: "${{ matrix.idf-version != 'release/v4.4' && '--cfg espidf_time64' || matrix.idf-version == 'release/v4.4' && '--cfg espidf_time32' }}"
        run: cargo build --examples --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort