Skip to content

Dedicated GPIO bundle initial implementation #17119

Dedicated GPIO bundle initial implementation

Dedicated GPIO bundle initial implementation #17119

Workflow file for this run

# 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 appropriate build command.
# 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"
- "backport-**"
- "release-branch-**"
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:
runs-on: macos-m1-self-hosted
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:
# load-blance runners a bit
group:
- xtensa
- riscv
steps:
- uses: actions/checkout@v6
# Install the Rust toolchain for Xtensa devices:
- uses: esp-rs/[email protected]
if: matrix.group == 'xtensa'
with:
version: 1.92.0.0
# Install the Rust stable toolchain for RISC-V devices:
- uses: dtolnay/rust-toolchain@v1
if: matrix.group == 'riscv'
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: stable
components: rust-src
- name: Setup cargo-batch
run: |
if ! command -v cargo-batch &> /dev/null; then
cargo install --git https://github.com/embassy-rs/cargo-batch cargo --bin cargo-batch --locked --force
fi
- name: Build and Check Xtensa
if: matrix.group == 'xtensa'
shell: bash
run: |
# lints and docs are checked separately
cargo xcheck ci esp32 --toolchain esp --no-lint --no-docs
cargo xcheck ci esp32s2 --toolchain esp --no-lint --no-docs
cargo xcheck ci esp32s3 --toolchain esp --no-lint --no-docs
- name: Build and Check RISC-V
if: matrix.group == 'riscv'
shell: bash
run: |
# lints and docs are checked separately
cargo xcheck ci esp32c2 --toolchain stable --no-lint --no-docs
cargo xcheck ci esp32c3 --toolchain stable --no-lint --no-docs
cargo xcheck ci esp32c6 --toolchain stable --no-lint --no-docs
cargo xcheck ci esp32h2 --toolchain stable --no-lint --no-docs
detect-extras-runner:
uses: ./.github/workflows/check_runner.yml
with:
primary-runner: macos-m1-self-hosted
fallback-runner: ubuntu-latest
extras:
needs: detect-extras-runner
runs-on: ${{ needs.detect-extras-runner.outputs.selected-runner }}
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
# Install dependencies for building the extra crates on ubuntu
- name: Install dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get -y install musl-tools libudev-dev pkg-config
# 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
docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group:
- xtensa
- riscv
steps:
- uses: actions/checkout@v6
# Install the Rust toolchain for Xtensa devices:
- uses: esp-rs/[email protected]
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:
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: nightly
components: rust-src
- name: Build Xtensa docs
if: matrix.group == 'xtensa'
shell: bash
run: cargo xtask build documentation --chips esp32,esp32s2,esp32s3
- name: Build RISC-V docs
if: matrix.group == 'riscv'
shell: bash
run: cargo xtask build documentation --chips esp32c2,esp32c3,esp32c6,esp32h2
# --------------------------------------------------------------------------
# MSRV
msrv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group:
- xtensa
- riscv
steps:
- uses: actions/checkout@v6
- uses: esp-rs/[email protected]
if: matrix.group == 'xtensa'
with:
version: ${{ env.MSRV }}
- name: esp toolchain checks
if: matrix.group == 'xtensa'
run: rustc +esp --version --verbose
- uses: dtolnay/rust-toolchain@v1
if: matrix.group == 'riscv'
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf,x86_64-unknown-linux-gnu
toolchain: ${{ env.MSRV }}
components: rust-src,clippy
- name: Stable toolchain checks
if: matrix.group == 'riscv'
run: rustc +${{ env.MSRV }} --version --verbose
# Verify the MSRV for all chips by running a lint session
- name: msrv RISC-V (esp-hal)
if: matrix.group == 'riscv'
run: |
cargo xtask lint-packages --chips esp32c2,esp32c3,esp32c6,esp32h2 --toolchain ${{ env.MSRV }}
- name: msrv Xtensa (esp-hal)
if: matrix.group == 'xtensa'
run: |
cargo xtask lint-packages --chips esp32,esp32s2,esp32s3 --toolchain esp
# --------------------------------------------------------------------------
# host tests
detect-host-tests-runner:
uses: ./.github/workflows/check_runner.yml
with:
primary-runner: macos-m1-self-hosted
fallback-runner: ubuntu-latest
host-tests:
needs: detect-host-tests-runner
runs-on: ${{ needs.detect-host-tests-runner.outputs.selected-runner }}
steps:
- uses: actions/checkout@v6
# 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
# Check metadata generation for all packages:
- run: cargo xtask update-metadata --check
# Run host tests for all applicable packages:
- run: cargo xtask host-tests
# --------------------------------------------------------------------------
# Check links in .rs, .md, and .toml files
link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lycheeverse/lychee-action@v2
with:
args: >
--verbose
--no-progress
--format detailed
--timeout 7
--max-concurrency 6
--retry-wait-time 3
--max-retries 6
--accept "200,301,302"
--exclude-path ".*/target/.*|.*/static\.files/.*|.*/docs/.*"
--remap "https://github.com/${{ github.repository }}/(?:blob|tree)/[^/]+/(.+) file://$GITHUB_WORKSPACE/\$1"
'./**/*.rs'
'./**/*.md'
'./**/*.toml'
# Dummy HIL test-build check for PRs
#
# This job only exists so that the required "build-tests-full (...)" checks
# are green on normal PR CI. It does NOT actually build tests.
#
# The real test builds run in hil.yml on merge_group (and when dispatched
# via `/hil full`) using a job with the same id + matrix, so the merge
# queue reuses these check names.
#
# For a reference, check out this GH discussion: https://github.com/orgs/community/discussions/102764
build-tests-full:
if: github.event_name != 'merge_group'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- soc: esp32c2
rust-target: riscv32imc-unknown-none-elf
runner: esp32c2-jtag
host: aarch64
- soc: esp32c3
rust-target: riscv32imc-unknown-none-elf
runner: esp32c3-usb
host: armv7
- soc: esp32c6
rust-target: riscv32imac-unknown-none-elf
runner: esp32c6-usb
host: armv7
- soc: esp32h2
rust-target: riscv32imac-unknown-none-elf
runner: esp32h2-usb
host: armv7
- soc: esp32
rust-target: xtensa-esp32-none-elf
runner: esp32-jtag
host: aarch64
- soc: esp32s2
rust-target: xtensa-esp32s2-none-elf
runner: esp32s2-jtag
host: armv7
- soc: esp32s3
rust-target: xtensa-esp32s3-none-elf
runner: esp32s3-usb
host: armv7
steps:
- name: Dummy placeholder for HIL test builds
run: |
echo "NOOP: Dummy build-tests-full for ${{ matrix.target.soc }}."
echo "Real HIL test builds run only in hil.yml (merge_group or /hil full)."