388 lines
14 KiB
YAML
388 lines
14 KiB
YAML
---
|
|
name: Validate ESPHome
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
push:
|
|
paths:
|
|
- "**/*.yml"
|
|
- "**/*.yaml"
|
|
- "**/*.h"
|
|
- "**/*.cpp"
|
|
- "**/*.c"
|
|
- "**/*.py"
|
|
|
|
pull_request:
|
|
paths:
|
|
- "**/*.yml"
|
|
- "**/*.yaml"
|
|
- "**/*.h"
|
|
- "**/*.cpp"
|
|
- "**/*.c"
|
|
- "**/*.py"
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
skip_dev:
|
|
description: 'Skip dev testing (test only on latest)'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
code_scan:
|
|
name: Code scan (YAML)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@main
|
|
- name: Setup Python
|
|
uses: actions/setup-python@main
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Install Yamllint
|
|
run: pip install yamllint
|
|
- name: Validate YAML files
|
|
run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} +
|
|
|
|
# Arduino Framework - Foundation (latest)
|
|
build_ard_core:
|
|
name: "🏗️ Arduino Core (latest)"
|
|
needs: code_scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Core - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_core.yaml"
|
|
version: latest
|
|
|
|
build_ard_basic:
|
|
name: "📦 Arduino Basic (latest)"
|
|
needs: build_ard_core
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Basic - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_basic.yaml"
|
|
version: latest
|
|
|
|
build_ard_hw_relays:
|
|
name: "🔌 Arduino HW Relays (latest)"
|
|
needs: [build_ard_core, build_ard_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino HW Relays - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_hw_relays.yaml"
|
|
version: latest
|
|
|
|
build_ard_hw_speaker:
|
|
name: "🔌 Arduino HW Speaker (latest)"
|
|
needs: [build_ard_core, build_ard_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino HW Speaker - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_hw_speaker.yaml"
|
|
version: latest
|
|
|
|
build_ard_hw_vibration:
|
|
name: "🔌 Arduino HW Vibration (latest)"
|
|
needs: [build_ard_core, build_ard_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino HW Vibration - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_hw_vibration.yaml"
|
|
version: latest
|
|
|
|
build_ard_ble_proxy_latest:
|
|
name: "⚡ Arduino BLE Proxy (latest)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino BLE Proxy - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_ble_proxy.yaml"
|
|
version: latest
|
|
|
|
build_ard_ble_proxy_dev:
|
|
name: "⚡ Arduino BLE Proxy (dev)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino BLE Proxy - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_ble_proxy.yaml"
|
|
version: dev
|
|
|
|
build_ard_media_player_latest:
|
|
name: "⚡ Arduino Media Player (latest)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Media Player - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_media_player.yaml"
|
|
version: latest
|
|
|
|
build_ard_media_player_dev:
|
|
name: "⚡ Arduino Media Player (dev)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Media Player - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_media_player.yaml"
|
|
version: dev
|
|
|
|
# IDF Framework - Foundation (latest)
|
|
build_idf_core:
|
|
name: "🏗️ IDF Core (latest)"
|
|
needs: code_scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Core - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_core.yaml"
|
|
version: latest
|
|
|
|
build_idf_basic:
|
|
name: "📦 IDF Basic (latest)"
|
|
needs: build_idf_core
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Basic - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_basic.yaml"
|
|
version: latest
|
|
|
|
build_idf_hw_relays:
|
|
name: "🔌 IDF HW Relays (latest)"
|
|
needs: [build_idf_core, build_idf_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF HW Relays - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_hw_relays.yaml"
|
|
version: latest
|
|
|
|
build_idf_hw_speaker:
|
|
name: "🔌 IDF HW Speaker (latest)"
|
|
needs: [build_idf_core, build_idf_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF HW Speaker - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_hw_speaker.yaml"
|
|
version: latest
|
|
|
|
build_idf_hw_vibration:
|
|
name: "🔌 IDF HW Vibration (latest)"
|
|
needs: [build_idf_core, build_idf_basic]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF HW Vibration - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_hw_vibration.yaml"
|
|
version: latest
|
|
|
|
build_idf_ble_proxy_latest:
|
|
name: "⚡ IDF BLE Proxy (latest)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF BLE Proxy - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_ble_proxy.yaml"
|
|
version: latest
|
|
|
|
build_idf_ble_proxy_dev:
|
|
name: "⚡ IDF BLE Proxy (dev)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF BLE Proxy - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_ble_proxy.yaml"
|
|
version: dev
|
|
|
|
build_idf_media_player_latest:
|
|
name: "⚡ IDF Media Player (latest)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Media Player - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_media_player.yaml"
|
|
version: latest
|
|
|
|
build_idf_media_player_dev:
|
|
name: "⚡ IDF Media Player (dev)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Media Player - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_media_player.yaml"
|
|
version: dev
|
|
|
|
# Results summary
|
|
build_summary:
|
|
name: "📊 Build Summary"
|
|
needs:
|
|
- build_ard_core
|
|
- build_ard_basic
|
|
- build_ard_hw_relays
|
|
- build_ard_hw_speaker
|
|
- build_ard_hw_vibration
|
|
- build_ard_ble_proxy_latest
|
|
- build_ard_ble_proxy_dev
|
|
- build_ard_media_player_latest
|
|
- build_ard_media_player_dev
|
|
- build_idf_core
|
|
- build_idf_basic
|
|
- build_idf_hw_relays
|
|
- build_idf_hw_speaker
|
|
- build_idf_hw_vibration
|
|
- build_idf_ble_proxy_latest
|
|
- build_idf_ble_proxy_dev
|
|
- build_idf_media_player_latest
|
|
- build_idf_media_player_dev
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Generate Results Summary
|
|
run: |
|
|
echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "**Strategy:** Framework-specific dependency chains with multi-version testing for advanced features" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Arduino Results
|
|
echo "### 🤖 Arduino Framework" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | ${{ needs.build_ard_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | ${{ needs.build_ard_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# IDF Results
|
|
echo "### 🔧 ESP-IDF Framework" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🏗️ Core | ${{ needs.build_idf_core.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 📦 Basic | ${{ needs.build_idf_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Relays | ${{ needs.build_idf_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Speaker | ${{ needs.build_idf_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🔌 HW Vibration | ${{ needs.build_idf_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ BLE Proxy | ${{ needs.build_idf_ble_proxy_latest.result }} | ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ Media Player | ${{ needs.build_idf_media_player_latest.result }} | ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Build counts
|
|
FOUNDATION_BUILDS=14 # 2+2+6+4 (core+basic+hw+features latest only)
|
|
ADDITIONAL_BUILDS=4 # BLE Proxy + Media Player on dev (if not skipped)
|
|
|
|
if [ "${{ inputs.skip_dev }}" == "true" ]; then
|
|
TOTAL=$FOUNDATION_BUILDS
|
|
echo "**Total builds:** $TOTAL (dev testing skipped)" >> $GITHUB_STEP_SUMMARY
|
|
else
|
|
TOTAL=$((FOUNDATION_BUILDS + ADDITIONAL_BUILDS))
|
|
echo "**Total builds:** $TOTAL ($FOUNDATION_BUILDS foundation + $ADDITIONAL_BUILDS dev testing)" >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
|
|
echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Overall Status
|
|
ARD_FAILED=false
|
|
IDF_FAILED=false
|
|
|
|
# Check Arduino chain (foundation components must pass)
|
|
if [ "${{ needs.build_ard_core.result }}" != "success" ] || \
|
|
[ "${{ needs.build_ard_basic.result }}" != "success" ]; then
|
|
ARD_FAILED=true
|
|
fi
|
|
|
|
# Check IDF chain (foundation components must pass)
|
|
if [ "${{ needs.build_idf_core.result }}" != "success" ] || \
|
|
[ "${{ needs.build_idf_basic.result }}" != "success" ]; then
|
|
IDF_FAILED=true
|
|
fi
|
|
|
|
# Generate final summary
|
|
if [ "$ARD_FAILED" == "true" ] && [ "$IDF_FAILED" == "true" ]; then
|
|
echo "❌ **Both frameworks failed** - Core issues affecting all builds" >> $GITHUB_STEP_SUMMARY
|
|
exit 1
|
|
elif [ "$ARD_FAILED" == "true" ]; then
|
|
echo "⚠️ **Arduino framework failed** - IDF builds may continue independently" >> $GITHUB_STEP_SUMMARY
|
|
exit 1
|
|
elif [ "$IDF_FAILED" == "true" ]; then
|
|
echo "⚠️ **ESP-IDF framework failed** - Arduino builds may continue independently" >> $GITHUB_STEP_SUMMARY
|
|
exit 1
|
|
else
|
|
echo "✅ **All foundation builds passed!** Both frameworks working correctly 🎉" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Check advanced features
|
|
if [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "failure" ] || \
|
|
[ "${{ needs.build_ard_media_player_dev.result }}" == "failure" ] || \
|
|
[ "${{ needs.build_idf_ble_proxy_dev.result }}" == "failure" ] || \
|
|
[ "${{ needs.build_idf_media_player_dev.result }}" == "failure" ]; then
|
|
echo "⚠️ **Some dev builds failed** - Advanced features may have compatibility issues with dev ESPHome" >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
fi
|
|
...
|