mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-26 20:00:32 +00:00
185 lines
5.7 KiB
YAML
185 lines
5.7 KiB
YAML
# NOTE:
|
|
#
|
|
# When adding support for a new chip to `esp-hal`, there are a number of
|
|
# updates which must be made to the CI workflow in order to reflect this; the
|
|
# changes are:
|
|
#
|
|
# 1.) In the 'esp-hal' job, add the name of the chip to the `matrix.soc` array.
|
|
# 1a.) If the device has a low-power core (which is supported in
|
|
# `esp-lp-hal`), then update the `if` condition to build prerequisites.
|
|
# 2.) In the 'msrv' job, add checks as needed for the new chip.
|
|
|
|
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
push:
|
|
branches-ignore:
|
|
- "gh-readonly-queue/**"
|
|
- "main"
|
|
merge_group:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
MSRV: "1.88.0"
|
|
DEFMT_LOG: trace
|
|
|
|
# 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:
|
|
# --------------------------------------------------------------------------
|
|
# Build Packages
|
|
|
|
esp-hal:
|
|
name: esp-hal (${{ matrix.device.soc }})
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CARGO_TARGET_DIR: ${{ github.workspace }}/target
|
|
CI: 1
|
|
SSID: SSID
|
|
PASSWORD: PASSWORD
|
|
STATIC_IP: 1.1.1.1
|
|
GATEWAY_IP: 1.1.1.1
|
|
HOST_IP: 1.1.1.1
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
device: [
|
|
# RISC-V devices:
|
|
{ soc: "esp32c2", toolchain: "stable" },
|
|
{ soc: "esp32c3", toolchain: "stable" },
|
|
{ soc: "esp32c6", toolchain: "stable" },
|
|
{ soc: "esp32h2", toolchain: "stable" },
|
|
# Xtensa devices:
|
|
{ soc: "esp32", toolchain: "esp" },
|
|
{ soc: "esp32s2", toolchain: "esp" },
|
|
{ soc: "esp32s3", toolchain: "esp" },
|
|
]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Install the Rust toolchain for Xtensa devices:
|
|
- uses: esp-rs/xtensa-toolchain@v1.6
|
|
with:
|
|
version: 1.88.0.0
|
|
|
|
# Install the Rust stable toolchain for RISC-V devices:
|
|
- uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
|
|
toolchain: stable
|
|
components: rust-src
|
|
# Install the Rust nightly toolchain for RISC-V devices, because of `-Zdoctest-xcompile`
|
|
- uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
|
|
toolchain: nightly
|
|
components: rust-src
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
prefix-key: "ci-${{ matrix.device.soc }}"
|
|
cache-all-crates: true
|
|
|
|
- name: Build and Check
|
|
shell: bash
|
|
run: cargo xcheck ci ${{ matrix.device.soc }} --toolchain ${{ matrix.device.toolchain }}
|
|
|
|
- name: Semver-Check
|
|
shell: bash
|
|
# always invokes +esp internally
|
|
run: cargo xcheck semver-check --chips ${{ matrix.device.soc }} check
|
|
|
|
extras:
|
|
runs-on: macos-m1-self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
|
|
# Build the extra crates
|
|
- name: Build the bench-server
|
|
run: cd extras/bench-server && cargo build
|
|
- name: Build esp-wifishark
|
|
run: cd extras/esp-wifishark && cargo build
|
|
- name: Build ieee802154-sniffer
|
|
run: cd extras/ieee802154-sniffer && cargo build
|
|
|
|
# --------------------------------------------------------------------------
|
|
# MSRV
|
|
|
|
msrv:
|
|
runs-on: macos-m1-self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: esp-rs/xtensa-toolchain@v1.6
|
|
with:
|
|
version: ${{ env.MSRV }}
|
|
- uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
|
|
toolchain: ${{ env.MSRV }}
|
|
components: rust-src,clippy
|
|
|
|
- name: Stable toolchain checks
|
|
run: rustc +${{ env.MSRV }} --version --verbose
|
|
- name: esp toolchain checks
|
|
run: rustc +esp --version --verbose
|
|
|
|
# Verify the MSRV for all chips by running a lint session
|
|
- name: msrv RISCV (esp-hal)
|
|
run: |
|
|
cargo xtask lint-packages --chips esp32c2,esp32c3,esp32c6,esp32h2 --toolchain ${{ env.MSRV }}
|
|
- name: msrv Xtensa (esp-hal)
|
|
run: |
|
|
cargo xtask lint-packages --chips esp32,esp32s2,esp32s3 --toolchain esp
|
|
|
|
# --------------------------------------------------------------------------
|
|
# host tests
|
|
|
|
host-tests:
|
|
runs-on: macos-m1-self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# Some of the configuration items in 'rustfmt.toml' require the 'nightly'
|
|
# release channel, MIRI is only available in nightly
|
|
- uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt,miri
|
|
|
|
# Run xtask tests
|
|
- name: Run xtask tests
|
|
run: cd xtask && cargo test --features release
|
|
|
|
# Check the formatting of all packages:
|
|
- run: cargo xtask fmt-packages --check
|
|
|
|
# Run tests in esp-config
|
|
- run: cd esp-config && cargo test --features build,tui
|
|
|
|
# Run tests in esp-bootloader-esp-idf
|
|
- run: cd esp-bootloader-esp-idf && cargo test --features=std
|
|
|
|
# Run tests in esp-storage
|
|
- run: cd esp-storage && cargo test --features=emulation -- --test-threads=1
|
|
- run: cd esp-storage && cargo test --features=emulation,bytewise-read -- --test-threads=1
|
|
|
|
# Miri tests in esp-storage
|
|
- run: cd esp-storage && cargo +nightly miri test --features=emulation -- --test-threads=1
|
|
- run: cd esp-storage && cargo +nightly miri test --features=emulation,bytewise-read -- --test-threads=1
|