From a9565f86b1704c44e36fda9c783dbb685d1b43e3 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:00:41 +0100 Subject: [PATCH] Copy from regular tests --- .github/workflows/validate_esphome_beta.yml | 123 +++++++++++++------- 1 file changed, 84 insertions(+), 39 deletions(-) diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index a78c1e25c..8de8fdf1e 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -1,8 +1,30 @@ --- -name: Validate ESPHome (beta) +name: Validate and Build ESPHome (beta) # yamllint disable-line rule:truthy on: + push: + paths: + - "nspanel_esphome*.yaml" + - "esphome/nspanel_esphome*.yaml" + - "prebuilt/nspanel_esphome*.yaml" + - "prebuilt/wall_display*.yaml" + - ".test/*.yaml" + - "*.h" + - "*.c" + - "*.cpp" + - "*.py" + pull_request: + paths: + - "nspanel_esphome*.yaml" + - "esphome/nspanel_esphome*.yaml" + - "prebuilt/nspanel_esphome*.yaml" + - "prebuilt/wall_display*.yaml" + - ".test/*.yaml" + - "*.h" + - "*.c" + - "*.cpp" + - "*.py" workflow_dispatch: concurrency: @@ -99,11 +121,11 @@ jobs: - name: Checkout repository uses: actions/checkout@main - - name: Firmware - if: steps.matrix.outputs.cache-hit != 'true' + - name: Build Firmware + if: matrix.cache-hit != 'true' uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml_file }} version: beta build_advanced: @@ -115,13 +137,13 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_advanced.yaml" + yaml-file: ".test/esphome_idf_advanced.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_advanced.yaml" + yaml-file: ".test/esphome_idf5_advanced.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_advanced.yaml" + yaml-file: ".test/esphome_ard_advanced.yaml" steps: - name: Checkout repository @@ -130,7 +152,7 @@ jobs: - name: Build Advanced Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_ble_tracker: @@ -142,10 +164,10 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_ble_tracker.yaml" + yaml-file: ".test/esphome_idf_ble_tracker.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_ble_tracker.yaml" + yaml-file: ".test/esphome_idf5_ble_tracker.yaml" steps: - name: Checkout repository @@ -154,7 +176,7 @@ jobs: - name: Build BLE Tracker Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_bluetooth_proxy: @@ -166,10 +188,10 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf_bluetooth_proxy.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf5_bluetooth_proxy.yaml" steps: - name: Checkout repository @@ -178,7 +200,7 @@ jobs: - name: Build Bluetooth Proxy Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_climate_cool: @@ -190,13 +212,13 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_climate_cool.yaml" + yaml-file: ".test/esphome_idf_climate_cool.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_climate_cool.yaml" + yaml-file: ".test/esphome_idf5_climate_cool.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_climate_cool.yaml" + yaml-file: ".test/esphome_ard_climate_cool.yaml" steps: - name: Checkout repository @@ -205,7 +227,7 @@ jobs: - name: Build Climate Cool Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_climate_heat: @@ -217,13 +239,13 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_climate_heat.yaml" + yaml-file: ".test/esphome_idf_climate_heat.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_climate_heat.yaml" + yaml-file: ".test/esphome_idf5_climate_heat.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_climate_heat.yaml" + yaml-file: ".test/esphome_ard_climate_heat.yaml" steps: - name: Checkout repository @@ -232,7 +254,7 @@ jobs: - name: Build Climate Heat Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_climate_dual: @@ -244,22 +266,22 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_climate_dual.yaml" + yaml-file: ".test/esphome_idf_climate_dual.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_climate_dual.yaml" + yaml-file: ".test/esphome_idf5_climate_dual.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_climate_dual.yaml" + yaml-file: ".test/esphome_ard_climate_dual.yaml" steps: - name: Checkout repository uses: actions/checkout@main - - name: Build Climate Dial Firmware + - name: Build Climate Dual Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_customizations: @@ -273,10 +295,10 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_advanced_climate_heat_customizations.yaml" + yaml-file: ".test/esphome_idf_advanced_climate_heat_customizations.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_advanced_climate_heat_customizations.yaml" + yaml-file: ".test/esphome_ard_advanced_climate_heat_customizations.yaml" steps: - name: Checkout repository @@ -285,7 +307,7 @@ jobs: - name: Build Customizations Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_climate_ble_proxy: @@ -299,7 +321,7 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_climate_cool_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf_climate_cool_bluetooth_proxy.yaml" steps: - name: Checkout repository @@ -308,7 +330,7 @@ jobs: - name: Build Customizations Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_cover: @@ -321,13 +343,13 @@ jobs: include: - id: idf_v4 base: idf_v4 - yaml_file: ".test/esphome_idf_cover.yaml" + yaml-file: ".test/esphome_idf_cover.yaml" - id: idf_v5 base: idf_v5 - yaml_file: ".test/esphome_idf5_cover.yaml" + yaml-file: ".test/esphome_idf5_cover.yaml" - id: ard base: ard - yaml_file: ".test/esphome_ard_cover.yaml" + yaml-file: ".test/esphome_ard_cover.yaml" steps: - name: Checkout repository @@ -336,26 +358,49 @@ jobs: - name: Build Cover Firmware uses: esphome/build-action@main with: - yaml_file: ${{ matrix.yaml_file }} + yaml-file: ${{ matrix.yaml-file }} version: beta build_prebuilt_firmware: name: Prebuilt Firmware runs-on: ubuntu-latest needs: code_scan - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: contains(github.ref, 'dev') || contains(github.base_ref, 'dev') steps: - uses: actions/checkout@main + - name: Extract Version Number + id: extract_version + run: | + VERSION=$(yq eval '.substitutions.version' esphome/nspanel_esphome_core_versioning.yaml) + if [ -z "$VERSION" ]; then + echo "Error: No version found in esphome/nspanel_esphome_core_versioning.yaml" + exit 1 + fi + echo "Extracted Version: ${VERSION}" + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Debug Version Output + run: | + echo "Version from setup_dependencies: ${{ steps.extract_version.outputs.version }}" + echo "Environment Variable VERSION: $VERSION" + if [ -z "${{ steps.extract_version.outputs.version }}" ]; then + echo "Error: Version output is empty. Exiting..." + exit 1 + fi + - name: Build ESPHome Prebuilt Firmware + id: build_nspanel_fw uses: esphome/build-action@main with: - yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml + yaml-file: prebuilt/nspanel_esphome_prebuilt.yaml version: beta - name: Build ESPHome Prebuilt Wall Display Firmware + id: build_wall_display_fw uses: esphome/build-action@main with: - yaml_file: prebuilt/wall_display.yaml + yaml-file: prebuilt/wall_display.yaml version: beta ...