From 54ac959abb7d1caf578a8302bfb492f8098cb4e5 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:07:06 +0200 Subject: [PATCH] Org test back on platform-centric --- .github/workflows/validate_esphome.yml | 366 ++++++++++++++++++------- 1 file changed, 261 insertions(+), 105 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index a70674b..0e2c8fb 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -52,162 +52,318 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - # Foundation Testing - Latest only (fast, stable) - build_core: - name: "🏗️ Core (${{ matrix.framework }})" + # Arduino Framework - Foundation + build_ard_core: + name: "🏗️ Arduino Core" needs: code_scan runs-on: ubuntu-latest - strategy: - fail-fast: true - max-parallel: 2 - matrix: - framework: [idf, ard] steps: - uses: actions/checkout@main - - name: Build Core + - name: Build Arduino Core uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_core.yaml" + yaml-file: ".test/esphome_ard_core.yaml" version: latest - build_basic: - name: "📦 Basic (${{ matrix.framework }})" - needs: build_core - if: success() + build_ard_basic: + name: "📦 Arduino Basic" + needs: build_ard_core runs-on: ubuntu-latest - strategy: - fail-fast: true - max-parallel: 2 - matrix: - framework: [idf, ard] steps: - uses: actions/checkout@main - - name: Build Basic + - name: Build Arduino Basic uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" + yaml-file: ".test/esphome_ard_basic.yaml" version: latest - build_hardware: - name: "🔌 ${{ matrix.target }} (${{ matrix.framework }})" - needs: [build_core, build_basic] - if: success() + build_ard_hw_relays: + name: "🔌 Arduino HW Relays" + needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - target: [hw_relays, hw_speaker, hw_vibration] steps: - uses: actions/checkout@main - - name: Build Hardware + - name: Build Arduino HW Relays uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + yaml-file: ".test/esphome_ard_hw_relays.yaml" version: latest - build_features: - name: "⚡ ${{ matrix.target }} (${{ matrix.framework }})" - needs: [build_core, build_basic, build_hardware] - if: success() + build_ard_hw_speaker: + name: "🔌 Arduino HW Speaker" + needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - target: [ble_proxy, media_player] steps: - uses: actions/checkout@main - - name: Build Features + - name: Build Arduino HW Speaker uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + yaml-file: ".test/esphome_ard_hw_speaker.yaml" version: latest - # Comprehensive Testing - Only after everything works - # Test complete system on latest (stable) + dev (bleeding edge) - build_comprehensive: - name: "🌍 Complete (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_core, build_basic, build_hardware, build_features] + build_ard_hw_vibration: + name: "🔌 Arduino HW Vibration" + needs: [build_ard_core, build_ard_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino HW Vibration + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_hw_vibration.yaml" + version: latest + + build_ard_ble_proxy: + name: "⚡ Arduino BLE Proxy" + 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 + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_ble_proxy.yaml" + version: latest + + build_ard_media_player: + name: "⚡ Arduino Media Player" + 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 + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_media_player.yaml" + version: latest + + # IDF Framework - Foundation + build_idf_core: + name: "🏗️ IDF Core" + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Core + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_core.yaml" + version: latest + + build_idf_basic: + name: "📦 IDF Basic" + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Basic + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: latest + + build_idf_hw_relays: + name: "🔌 IDF HW Relays" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Relays + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_relays.yaml" + version: latest + + build_idf_hw_speaker: + name: "🔌 IDF HW Speaker" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Speaker + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_speaker.yaml" + version: latest + + build_idf_hw_vibration: + name: "🔌 IDF HW Vibration" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Vibration + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_vibration.yaml" + version: latest + + build_idf_ble_proxy: + name: "⚡ IDF BLE Proxy" + 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 + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_ble_proxy.yaml" + version: latest + + build_idf_media_player: + name: "⚡ IDF Media Player" + 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 + 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 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - version: [latest, dev] # Only two versions: stable + cutting-edge steps: - uses: actions/checkout@main - - name: Build Complete System + - name: Build Arduino Complete - latest uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" - version: ${{ matrix.version }} + 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: "📊 Summary" - needs: [build_core, build_basic, build_hardware, build_features, build_comprehensive] + 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: Results + - name: Generate Results Summary run: | - echo "## 📋 Build Summary" >> $GITHUB_STEP_SUMMARY + echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy: Foundation on stable, validation on stable + dev**" >> $GITHUB_STEP_SUMMARY - echo "**Build Order: Core → Basic → Hardware → Features → Complete**" >> $GITHUB_STEP_SUMMARY + echo "**Strategy:** Framework-specific dependency chains with independent failure paths" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # Build counts - FOUNDATION_BUILDS=14 # 2+2+6+4 - COMPREHENSIVE_BUILDS=4 # 2 frameworks × 2 versions + # 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 - if [ "${{ needs.build_comprehensive.result }}" == "skipped" ]; then - TOTAL=$FOUNDATION_BUILDS - echo "**Builds run:** $TOTAL (foundation only)" >> $GITHUB_STEP_SUMMARY - else - TOTAL=$((FOUNDATION_BUILDS + COMPREHENSIVE_BUILDS)) - echo "**Builds run:** $TOTAL ($FOUNDATION_BUILDS foundation + $COMPREHENSIVE_BUILDS comprehensive)" >> $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 - echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY + # Check IDF chain + if [ "${{ needs.build_idf_core.result }}" != "success" ] || \ + [ "${{ needs.build_idf_basic.result }}" != "success" ]; then + IDF_FAILED=true + fi - # Results - echo "| Stage | Result |" >> $GITHUB_STEP_SUMMARY - echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Foundation | ${{ needs.build_core.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic (Most Common) | ${{ needs.build_basic.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Features | ${{ needs.build_features.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Multi-version | ${{ needs.build_comprehensive.result }} |" >> $GITHUB_STEP_SUMMARY - - # Final status - if [ "${{ needs.build_core.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Core foundation failed** - Fix core components first" >> $GITHUB_STEP_SUMMARY + # 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 [ "${{ needs.build_basic.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Basic build failed** - Most common configuration has issues" >> $GITHUB_STEP_SUMMARY + elif [ "$ARD_FAILED" == "true" ]; then + echo "⚠️ **Arduino framework failed** - IDF builds may continue independently" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_hardware.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Hardware builds failed** - Individual components have issues" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "${{ needs.build_features.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Feature builds failed** - Advanced features have issues" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "${{ needs.build_comprehensive.result }}" == "failure" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "⚠️ **Multi-version testing failed** - Works on latest, issues with dev" >> $GITHUB_STEP_SUMMARY + elif [ "$IDF_FAILED" == "true" ]; then + echo "⚠️ **ESP-IDF framework failed** - Arduino builds may continue independently" >> $GITHUB_STEP_SUMMARY exit 1 else - echo "" >> $GITHUB_STEP_SUMMARY - echo "✅ **All builds passed!** Ready for production 🚀" >> $GITHUB_STEP_SUMMARY + echo "✅ **All foundation builds passed!** Both frameworks working correctly 🎉" >> $GITHUB_STEP_SUMMARY fi ...