370 lines
13 KiB
YAML
370 lines
13 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:
|
|
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_media_player:
|
|
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
|
|
|
|
# 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:
|
|
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_media_player:
|
|
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
|
|
|
|
# Comprehensive Testing - Multi-version validation
|
|
build_comprehensive_ard_latest:
|
|
name: "🌍 Arduino Complete (latest)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Complete - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_basic.yaml"
|
|
version: latest
|
|
|
|
build_comprehensive_ard_dev:
|
|
name: "🌍 Arduino Complete (dev)"
|
|
needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build Arduino Complete - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_ard_basic.yaml"
|
|
version: dev
|
|
|
|
build_comprehensive_idf_latest:
|
|
name: "🌍 IDF Complete (latest)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Complete - latest
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_basic.yaml"
|
|
version: latest
|
|
|
|
build_comprehensive_idf_dev:
|
|
name: "🌍 IDF Complete (dev)"
|
|
needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player]
|
|
if: success() && !inputs.skip_dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- name: Build IDF Complete - dev
|
|
uses: esphome/build-action@main
|
|
with:
|
|
yaml-file: ".test/esphome_idf_basic.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
|
|
- build_ard_media_player
|
|
- build_idf_core
|
|
- build_idf_basic
|
|
- build_idf_hw_relays
|
|
- build_idf_hw_speaker
|
|
- build_idf_hw_vibration
|
|
- build_idf_ble_proxy
|
|
- build_idf_media_player
|
|
- build_comprehensive_ard_latest
|
|
- build_comprehensive_ard_dev
|
|
- build_comprehensive_idf_latest
|
|
- build_comprehensive_idf_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 independent failure paths" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Arduino Results
|
|
echo "### 🤖 Arduino Framework" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Component | Status |" >> $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.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ Media Player | ${{ needs.build_ard_media_player.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_ard_latest.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_ard_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# IDF Results
|
|
echo "### 🔧 ESP-IDF Framework" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Component | Status |" >> $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.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| ⚡ Media Player | ${{ needs.build_idf_media_player.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_idf_latest.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_idf_dev.result }} |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# Overall Status
|
|
ARD_FAILED=false
|
|
IDF_FAILED=false
|
|
|
|
# Check Arduino chain
|
|
if [ "${{ needs.build_ard_core.result }}" != "success" ] || \
|
|
[ "${{ needs.build_ard_basic.result }}" != "success" ]; then
|
|
ARD_FAILED=true
|
|
fi
|
|
|
|
# Check IDF chain
|
|
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
|
|
fi
|
|
...
|