Skip to content

Tests all components #17

Tests all components

Tests all components #17

Workflow file for this run

name: ESPHome CI
on:
push:
branches: [main]
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
configs: ${{ steps.find.outputs.configs }}
steps:
- uses: actions/checkout@v4
- id: find
run: |
configs=$(find examples -type f \( -name '*.yaml' -o -name '*.yml' \) \
! -name 'm5stack.yaml' \
! -name 'esp32_external_dac.yaml' | sort | jq -R -s -c 'split("\n")[:-1]')
echo "configs=$configs" >> "$GITHUB_OUTPUT"
validate:
runs-on: ubuntu-latest
needs: prepare
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.prepare.outputs.configs) }}
steps:
- uses: actions/checkout@v4
- name: Install yq
run: sudo apt-get update && sudo apt-get install -y yq
- name: ESPHome setup
uses: ./.github/actions/esphome-setup
with:
create-secrets: "true"
- name: Inject extra package files
run: |
yq -i -y '
(.packages.remote_package.files //= []) |
(.packages.remote_package.files) += [
"components/extra-sensors.yaml",
"components/register_dump.yaml"
] |
(.packages.remote_package.files) |= unique
' "${{ matrix.config }}"
- name: Validate config
run: esphome config "${{ matrix.config }}"
compile:
runs-on: ubuntu-latest
needs: prepare
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.prepare.outputs.configs) }}
steps:
- uses: actions/checkout@v4
- name: Install yq
run: sudo apt-get update && sudo apt-get install -y yq
- name: ESPHome setup
uses: ./.github/actions/esphome-setup
with:
create-secrets: "true"
- name: Inject extra package files
run: |
yq -i -y '
(.packages.remote_package.files //= []) |
(.packages.remote_package.files) += [
"components/extra-sensors.yaml",
"components/register_dump.yaml"
] |
(.packages.remote_package.files) |= unique
' "${{ matrix.config }}"
- name: Compile config
run: esphome compile "${{ matrix.config }}"