Files
NSPanel_HA_Blueprint/.github/workflows/validate_esphome.yml
Edward Firmo 5f850ae6a3 Remove pre-build test & build for now
PR#5586 is quite active and breaking this. Waiting until it is more stable.
2024-03-19 09:51:27 +01:00

251 lines
8.0 KiB
YAML

---
name: Validate ESPHome
# yamllint disable-line rule:truthy
on:
push:
paths:
- "nspanel_esphome*.yaml"
- "esphome/nspanel_esphome*.yaml"
- "prebuilt/nspanel_esphome*.yaml"
- ".test/*.yaml"
- "*.h"
- "*.c"
- "*.cpp"
- "*.py"
pull_request:
paths:
- "nspanel_esphome*.yaml"
- "esphome/nspanel_esphome*.yaml"
- "prebuilt/nspanel_esphome*.yaml"
- ".test/*.yaml"
- "*.h"
- "*.c"
- "*.cpp"
- "*.py"
workflow_dispatch:
concurrency:
# yamllint disable-line rule:line-length
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:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Validate nspanel_esphome.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome.yaml
- name: Validate nspanel_esphome_core.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_core.yaml
- name: Validate nspanel_esphome_addon_climate_cool.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome_addon_climate_cool.yaml
- name: Validate nspanel_esphome_addon_climate_heat.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome_addon_climate_heat.yaml
- name: Validate nspanel_esphome_addon_climate_dual.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome_addon_climate_dual.yaml
- name: Validate nspanel_esphome_addon_upload_tft.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_addon_upload_tft.yaml
- name: Validate nspanel_esphome_advanced.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_advanced.yaml
- name: Validate nspanel_esphome_addon_climate_base.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_addon_climate_base.yaml
- name: Validate nspanel_esphome_addon_climate_cool.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_addon_climate_cool.yaml
- name: Validate nspanel_esphome_addon_climate_heat.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_addon_climate_heat.yaml
- name: Validate nspanel_esphome_addon_climate_dual.yaml
run: yamllint -c "./.rules/yamllint.yml" esphome/nspanel_esphome_addon_climate_dual.yaml
build_core:
name: Core
runs-on: "ubuntu-latest"
needs:
- code_scan
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_basic.yaml"
build_advanced:
name: Advanced
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+advanced
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_advanced.yaml"
build_climate_heat:
name: Climate (heat)
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+climate_heat
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_climate_heat.yaml"
build_climate_cool:
name: Climate (cool)
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+climate_cool
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_climate_cool.yaml"
build_climate_dual:
name: Climate (dual)
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+climate_dual
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_climate_dual.yaml"
build_climate_heat_advanced:
name: Advanced+climate (heat)
runs-on: "ubuntu-latest"
needs:
- build_climate_heat
- build_advanced
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+advanced+climate_heat
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat.yaml"
build_climate_cool_advanced_arduino:
name: Arduino
runs-on: "ubuntu-latest"
needs:
- build_climate_cool
- build_advanced
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+advanced+climate_cool+arduino
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_advanced_climate_cool_arduino.yaml"
build_climate_dual_esp_idf5:
name: esp-idf v5 & Climate Dual & Bluetooth proxy
runs-on: "ubuntu-latest"
needs:
- build_advanced
- build_climate_dual
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+climate_dual+bt_proxy+esp_idf5
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_advanced_climate_dual_esp_idf5.yaml"
build_climate_heat_advanced_customization:
name: Customizations
runs-on: "ubuntu-latest"
needs:
- build_climate_heat_advanced
- build_climate_cool_bluetooth_proxy
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+advanced+climate_heat+customizations
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat_customizations.yaml"
# build_prebuilt_firmware:
# name: Prebuilt Firmware
# runs-on: ubuntu-latest
# needs: build_core # Ensure this job runs after the core build job
# if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
# steps:
# - uses: actions/checkout@main
# with:
# fetch-depth: '0'
# - name: Build ESPHome Prebuilt Firmware
# uses: barndawgie/build-action@v1.9.0
# with:
# yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml
# - name: Move and Rename Firmware File
# run: |
# mkdir -p prebuilt
# cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/nspanel_esphome_prebuilt.bin || true
# cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/nspanel_esphome_prebuilt-factory.bin || true
# - name: Set Commit Message
# id: set_commit_message
# run: |
# if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - ${{ github.event.pull_request.title }}" >> $GITHUB_ENV
# elif [[ "${{ github.event_name }}" == "push" ]]; then
# commit_message=$(git log -1 --pretty=format:'%s')
# echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - $commit_message" >> $GITHUB_ENV
# else
# echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel" >> $GITHUB_ENV
# fi
# - name: Commit and Push Firmware Files
# run: |
# git config --global user.name 'GitHub Actions'
# git config --global user.email 'actions@github.com'
# git add prebuilt/*.bin
# git commit -m "${{ env.COMMIT_MESSAGE }}"
# git push
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_climate_cool_bluetooth_proxy:
name: Climate cool & BLE proxy
runs-on: "ubuntu-latest"
needs:
- build_climate_cool
steps:
- uses: actions/checkout@main
with:
fetch-depth: '0'
- name: Build core+climate_cool+bluetooth_proxy
uses: barndawgie/build-action@v1.9.0
with:
yaml_file: "./.test/esphome_climate_cool_bluetooth_proxy.yaml"
...