Files
ainyan03 063ee106be ci: add Arduino and ESP-IDF build check workflows
Adds two GitHub Actions workflows that compile a small smoke test
across all supported ESP32-family SoCs:

  * ArduinoBuild.yml: arduino-cli matrix
      - Espressif core 2.0.17 / 3.1.1 (esp32, s3, c3, c6, p4, h2)
      - M5Stack core 2.1.4 / 3.2.5 (m5stack_core, m5stack_cores3)
  * IDFBuild.yml: ESP-IDF v5.1.6 / v5.3 container matrix
      - esp32, s3, c3, c6, h2, p4

The smoke test (examples/Test/build_test/) exercises the main M5Unified
APIs (Display, Speaker, Mic, Imu, Touch, Button, Power, Rtc, Log) so
a missing-symbol regression on any target shows up as a build failure.

The M5GFX dependency is fetched at run time:
  * Branch: same name as the operation target (master -> master,
    everything else -> develop).
  * Repo: prefer the same owner's fork (e.g. ainyan03/M5GFX when
    running on ainyan03/M5Unified), fall back to upstream m5stack/M5GFX
    if the same-name branch is missing in the fork.

This lets the workflow validate "fork develop x fork develop" while
still working unchanged on the upstream m5stack/M5Unified repo.
2026-05-08 13:56:20 +09:00

89 lines
2.5 KiB
YAML

name: ESP-IDF Build
on:
push:
paths:
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**/CMakeLists.txt'
- '.github/workflows/IDFBuild.yml'
pull_request:
workflow_dispatch:
jobs:
build:
name: ${{ matrix.target }} (IDF ${{ matrix.idf_version }})
runs-on: ubuntu-latest
container:
image: espressif/idf:v${{ matrix.idf_version }}
strategy:
fail-fast: false
matrix:
include:
# ESP32
- target: esp32
idf_version: "5.3"
- target: esp32
idf_version: "5.1.6"
# ESP32-S3
- target: esp32s3
idf_version: "5.3"
- target: esp32s3
idf_version: "5.1.6"
# ESP32-C3
- target: esp32c3
idf_version: "5.3"
- target: esp32c3
idf_version: "5.1.6"
# ESP32-C6 (IDF 5.3+ only)
- target: esp32c6
idf_version: "5.3"
# ESP32-H2
- target: esp32h2
idf_version: "5.3"
- target: esp32h2
idf_version: "5.1.6"
# ESP32-P4 (IDF 5.3+ only)
- target: esp32p4
idf_version: "5.3"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine M5GFX repo and branch
id: m5gfx
shell: bash
run: |
OWNER="${{ github.repository_owner }}"
BRANCH="${{ github.base_ref || github.ref_name }}"
[ "$BRANCH" = "master" ] || BRANCH="develop"
# Prefer same owner's fork (e.g. ainyan03/M5GFX); fall back to upstream m5stack/M5GFX
if git ls-remote --heads "https://github.com/$OWNER/M5GFX.git" "$BRANCH" 2>/dev/null | grep -q .; then
REPO="$OWNER/M5GFX"
else
REPO="m5stack/M5GFX"
fi
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
echo "Using $REPO@$BRANCH"
- name: Clone M5GFX (matched repo and branch)
shell: bash
run: |
git clone --depth 1 --branch "${{ steps.m5gfx.outputs.branch }}" \
"https://github.com/${{ steps.m5gfx.outputs.repo }}.git" \
"$GITHUB_WORKSPACE/_deps/M5GFX"
- name: Build
working-directory: examples/Test/build_test
shell: bash
env:
M5GFX_PATH: ${{ github.workspace }}/_deps/M5GFX
run: |
. $IDF_PATH/export.sh
idf.py set-target ${{ matrix.target }}
idf.py build