mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-22 20:20:35 +02:00
Adopt structure of the ESPHome CI (#61)
Some checks failed
CI / yamllint (push) Has been cancelled
CI / Bundle external component and ESPHome (push) Has been cancelled
CI / Create common environment (push) Has been cancelled
CI / Check ruff (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / Validate example configurations (push) Has been cancelled
CI / Build example configurations (push) Has been cancelled
Some checks failed
CI / yamllint (push) Has been cancelled
CI / Bundle external component and ESPHome (push) Has been cancelled
CI / Create common environment (push) Has been cancelled
CI / Check ruff (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / Validate example configurations (push) Has been cancelled
CI / Build example configurations (push) Has been cancelled
This commit is contained in:
committed by
GitHub
parent
eeede3e32e
commit
5dc30e99fe
38
.github/actions/restore-python/action.yml
vendored
Normal file
38
.github/actions/restore-python/action.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Restore Python
|
||||
inputs:
|
||||
python-version:
|
||||
description: Python version to restore
|
||||
required: true
|
||||
type: string
|
||||
cache-key:
|
||||
description: Cache key to use
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
python-version:
|
||||
description: Python version restored
|
||||
value: ${{ steps.python.outputs.python-version }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
id: python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
- name: Restore Python virtual environment
|
||||
id: cache-venv
|
||||
uses: actions/cache/restore@v4.2.3
|
||||
with:
|
||||
path: venv
|
||||
# yamllint disable-line rule:line-length
|
||||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ inputs.cache-key }}
|
||||
- name: Create Python virtual environment
|
||||
shell: bash
|
||||
run: |
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
python --version
|
||||
cd esphome
|
||||
pip install -r requirements.txt -r requirements_test.txt
|
||||
pip install -e .
|
603
.github/workflows/ci.yaml
vendored
603
.github/workflows/ci.yaml
vendored
@@ -4,247 +4,462 @@ on: # yamllint disable-line rule:truthy
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: 0 12 * * *
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
DEFAULT_PYTHON: "3.9"
|
||||
PYUPGRADE_TARGET: "--py39-plus"
|
||||
|
||||
concurrency:
|
||||
# yamllint disable-line rule:line-length
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
yamllint:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: yaml-lint
|
||||
uses: ibiqlik/action-yamllint@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run yamllint
|
||||
uses: frenck/action-yamllint@v1
|
||||
with:
|
||||
config_file: .yamllint
|
||||
config: .yamllint
|
||||
|
||||
lint-clang-format:
|
||||
env:
|
||||
esphome_directory: esphome
|
||||
runs-on: ubuntu-latest
|
||||
bundle:
|
||||
name: Bundle external component and ESPHome
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
repo-hash: ${{ github.sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Cache pip modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: esphome-pip-3.12-${{ hashFiles('setup.py') }}
|
||||
restore-keys: |
|
||||
esphome-pip-3.12-
|
||||
- name: Check out this project
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: 💣 Clone esphome project
|
||||
run: git clone https://github.com/esphome/esphome.git
|
||||
- name: 💣 Copy component into the esphome project
|
||||
- name: Check out code from ESPHome project
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: esphome/esphome
|
||||
ref: dev
|
||||
path: esphome
|
||||
|
||||
- name: Copy external component into the esphome project
|
||||
run: |
|
||||
cd esphome
|
||||
cp -r ../components/* esphome/components/
|
||||
git config user.name "ci"
|
||||
git config user.email "ci@github.com"
|
||||
git add .
|
||||
git commit -a -m "Add external component"
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
ln -sf ../venv venv
|
||||
|
||||
- name: Add missing requirements
|
||||
run: pip3 install setuptools wheel
|
||||
- name: Set up python environment
|
||||
run: VIRTUAL_ENV=false script/setup
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
- name: Archive prepared repository
|
||||
uses: pyTooling/upload-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
include-hidden-files: true
|
||||
retention-days: 1
|
||||
|
||||
# Set up the pio project so that the cpp checks know how files are compiled
|
||||
# (build flags, libraries etc)
|
||||
- name: Set up platformio environment
|
||||
run: pio init --ide vscode
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Run clang-format
|
||||
run: script/clang-format -i
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Suggest changes
|
||||
run: script/ci-suggest-changes
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
lint-clang-tidy:
|
||||
env:
|
||||
esphome_directory: esphome
|
||||
runs-on: ubuntu-latest
|
||||
common:
|
||||
name: Create common environment
|
||||
runs-on: ubuntu-24.04
|
||||
needs: bundle
|
||||
outputs:
|
||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Cache pip modules
|
||||
uses: actions/cache@v4
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Generate cache-key
|
||||
id: cache-key
|
||||
run: echo key="${{ hashFiles('esphome/requirements.txt', 'esphome/requirements_test.txt') }}" >> $GITHUB_OUTPUT
|
||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||
id: python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: esphome-pip-3.12-${{ hashFiles('setup.py') }}
|
||||
restore-keys: |
|
||||
esphome-pip-3.12-
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
- name: Restore Python virtual environment
|
||||
id: cache-venv
|
||||
uses: actions/cache@v4.2.3
|
||||
with:
|
||||
path: venv
|
||||
# yamllint disable-line rule:line-length
|
||||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ steps.cache-key.outputs.key }}
|
||||
|
||||
- name: 💣Clone esphome project
|
||||
run: git clone https://github.com/esphome/esphome.git
|
||||
- name: 💣Copy component into the esphome project
|
||||
- name: Create Python virtual environment
|
||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cp -r ../components/* esphome/components/
|
||||
git config user.name "ci"
|
||||
git config user.email "ci@github.com"
|
||||
git add .
|
||||
git commit -a -m "Add external component"
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
python -m venv venv
|
||||
. venv/bin/activate
|
||||
python --version
|
||||
cd esphome
|
||||
pip install -r requirements.txt -r requirements_test.txt
|
||||
pip install -e .
|
||||
|
||||
- name: Add missing requirements
|
||||
run: pip3 install setuptools wheel
|
||||
- name: Set up python environment
|
||||
run: VIRTUAL_ENV=false script/setup
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
# Set up the pio project so that the cpp checks know how files are compiled
|
||||
# (build flags, libraries etc)
|
||||
- name: Set up platformio environment
|
||||
run: pio init --ide vscode
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Register problem matchers
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
|
||||
echo "::add-matcher::.github/workflows/matchers/gcc.json"
|
||||
- name: Run lint-cpp
|
||||
run: script/lint-cpp -c
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
- name: Suggest changes
|
||||
run: script/ci-suggest-changes
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
lint-python:
|
||||
env:
|
||||
esphome_directory: esphome
|
||||
# Don't use the esphome-lint docker image because it may contain outdated requirements.
|
||||
# This way, all dependencies are cached via the cache action.
|
||||
runs-on: ubuntu-latest
|
||||
ruff:
|
||||
name: Check ruff
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Cache pip modules
|
||||
uses: actions/cache@v4
|
||||
name: bundle
|
||||
path: .
|
||||
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: esphome-pip-3.12-${{ hashFiles('setup.py') }}
|
||||
restore-keys: |
|
||||
esphome-pip-3.12-
|
||||
|
||||
- name: 💣Clone esphome project
|
||||
run: git clone https://github.com/esphome/esphome.git
|
||||
- name: 💣Copy component into the esphome project
|
||||
run: |
|
||||
cp -r ../components/* esphome/components/
|
||||
git config user.name "ci"
|
||||
git config user.email "ci@github.com"
|
||||
git add .
|
||||
git commit -a -m "Add external component"
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Add missing requirements
|
||||
run: pip3 install setuptools wheel
|
||||
- name: Set up python environment
|
||||
run: VIRTUAL_ENV=false script/setup
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Register problem matchers
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
|
||||
echo "::add-matcher::.github/workflows/matchers/lint-python.json"
|
||||
echo "::add-matcher::.github/workflows/matchers/python.json"
|
||||
|
||||
- name: Lint Custom
|
||||
run: script/ci-custom.py -c
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Run Ruff
|
||||
run: ruff format esphome tests
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
- name: Suggest changes
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
ruff format esphome tests
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
if: always()
|
||||
|
||||
flake8:
|
||||
name: Check flake8
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Run flake8
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
flake8 esphome
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
if: always()
|
||||
|
||||
pylint:
|
||||
name: Check pylint
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Run pylint
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
pylint -f parseable --persistent=n esphome
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
if: always()
|
||||
|
||||
pyupgrade:
|
||||
name: Check pyupgrade
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Run pyupgrade
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
pyupgrade ${{ env.PYUPGRADE_TARGET }} `find esphome -name "*.py" -type f`
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
if: always()
|
||||
|
||||
ci-custom:
|
||||
name: Run script/ci-custom
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Register matcher
|
||||
run: echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
|
||||
|
||||
- name: Do not suggest to move consts
|
||||
run: |
|
||||
sed -i 's#if len(uses) < 3:#if len(uses) < 8:#' script/ci-custom.py
|
||||
git update-index --assume-unchanged script/ci-custom.py
|
||||
|
||||
- name: Run script/ci-custom
|
||||
run: |
|
||||
. ../venv/bin/activate
|
||||
script/ci-custom.py
|
||||
|
||||
clang-format:
|
||||
name: Check clang-format
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
pip install clang-format -c requirements_dev.txt
|
||||
- name: Run clang-format
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
script/clang-format -i
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
if: always()
|
||||
|
||||
clang-tidy:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
defaults:
|
||||
run:
|
||||
working-directory: esphome
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
include:
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP8266
|
||||
options: --environment esp8266-arduino-tidy --grep USE_ESP8266
|
||||
pio_cache_key: tidyesp8266
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP32 Arduino 1/4
|
||||
options: --environment esp32-arduino-tidy --split-num 4 --split-at 1
|
||||
pio_cache_key: tidyesp32
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP32 Arduino 2/4
|
||||
options: --environment esp32-arduino-tidy --split-num 4 --split-at 2
|
||||
pio_cache_key: tidyesp32
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP32 Arduino 3/4
|
||||
options: --environment esp32-arduino-tidy --split-num 4 --split-at 3
|
||||
pio_cache_key: tidyesp32
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP32 Arduino 4/4
|
||||
options: --environment esp32-arduino-tidy --split-num 4 --split-at 4
|
||||
pio_cache_key: tidyesp32
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for ESP32 IDF
|
||||
options: --environment esp32-idf-tidy --grep USE_ESP_IDF
|
||||
pio_cache_key: tidyesp32-idf
|
||||
|
||||
steps:
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
name: bundle
|
||||
path: .
|
||||
- name: Update index to make "git diff-index" happy
|
||||
run: git update-index -q --really-refresh
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
|
||||
- name: Cache platformio
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
uses: actions/cache@v4.2.3
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: platformio-${{ matrix.pio_cache_key }}
|
||||
|
||||
- name: Cache platformio
|
||||
if: github.ref != 'refs/heads/dev'
|
||||
uses: actions/cache/restore@v4.2.3
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: platformio-${{ matrix.pio_cache_key }}
|
||||
|
||||
- name: Register problem matchers
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/matchers/gcc.json"
|
||||
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
|
||||
|
||||
- name: Run 'pio run --list-targets -e esp32-idf-tidy'
|
||||
if: matrix.name == 'Run script/clang-tidy for ESP32 IDF'
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
mkdir -p .temp
|
||||
pio run --list-targets -e esp32-idf-tidy
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
script/clang-tidy --all-headers --fix ${{ matrix.options }} ../components
|
||||
env:
|
||||
# Also cache libdeps, store them in a ~/.platformio subfolder
|
||||
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
|
||||
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
# yamllint disable-line rule:line-length
|
||||
if: always()
|
||||
|
||||
esphome-config:
|
||||
runs-on: ubuntu-latest
|
||||
name: Validate example configurations
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
steps:
|
||||
- name: ⤵️ Check out configuration from GitHub
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Python 3.12
|
||||
uses: actions/setup-python@v1
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Install dependencies
|
||||
name: bundle
|
||||
path: .
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
|
||||
- name: Validate example configurations
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
pip install esphome
|
||||
pip list
|
||||
esphome version
|
||||
- name: Write secrets.yaml
|
||||
shell: bash
|
||||
run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml'
|
||||
- name: Write tests/secrets.yaml
|
||||
shell: bash
|
||||
run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > tests/secrets.yaml'
|
||||
- run: |
|
||||
. venv/bin/activate
|
||||
echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml
|
||||
for YAML in esp*.yaml; do
|
||||
esphome -s external_components_source components config $YAML >/dev/null
|
||||
done
|
||||
- run: |
|
||||
|
||||
- name: Validate test configurations
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > tests/secrets.yaml
|
||||
for YAML in tests/esp*.yaml; do
|
||||
esphome -s external_components_source components config $YAML >/dev/null
|
||||
esphome -s external_components_source ../components config $YAML >/dev/null
|
||||
done
|
||||
|
||||
esphome-compile:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [esphome-config]
|
||||
name: Build example configurations
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- bundle
|
||||
- common
|
||||
steps:
|
||||
- name: ⤵️ Check out configuration from GitHub
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache .esphome
|
||||
uses: actions/cache@v4
|
||||
- name: Download prepared repository
|
||||
uses: pyTooling/download-artifact@v4
|
||||
with:
|
||||
path: .esphome
|
||||
key: esphome-compile-esphome-${{ hashFiles('*.yaml') }}
|
||||
restore-keys: esphome-compile-esphome-
|
||||
- name: Cache .pioenvs
|
||||
uses: actions/cache@v4
|
||||
name: bundle
|
||||
path: .
|
||||
|
||||
- name: Restore Python
|
||||
uses: ./.github/actions/restore-python
|
||||
with:
|
||||
path: .pioenvs
|
||||
key: esphome-compile-pioenvs-${{ hashFiles('*.yaml') }}
|
||||
restore-keys: esphome-compile-pioenvs-
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Install dependencies
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
|
||||
- name: Compile example configurations
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
pip install esphome
|
||||
pip list
|
||||
esphome version
|
||||
- name: Register problem matchers
|
||||
. venv/bin/activate
|
||||
echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml
|
||||
for YAML in esp*faker.yaml; do
|
||||
esphome -s external_components_source components compile $YAML >/dev/null
|
||||
done
|
||||
|
||||
- name: Compile test configurations
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/matchers/gcc.json"
|
||||
echo "::add-matcher::.github/workflows/matchers/python.json"
|
||||
- name: Write secrets.yaml
|
||||
shell: bash
|
||||
run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml'
|
||||
- run: |
|
||||
esphome -s external_components_source components compile esp32-ble-example-faker.yaml
|
||||
- run: |
|
||||
esphome -s external_components_source components compile esp8266-solar-charger-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-charger-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-charging-converter-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-smart-shunt-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-triple-charger-example-faker.yaml
|
||||
. venv/bin/activate
|
||||
echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > tests/secrets.yaml
|
||||
esphome -s external_components_source ../components compile tests/esp32c6-compatibility-test.yaml
|
||||
|
179
tests/esp32c6-compatibility-test.yaml
Normal file
179
tests/esp32c6-compatibility-test.yaml
Normal file
@@ -0,0 +1,179 @@
|
||||
substitutions:
|
||||
name: esp32c6-compatibility-test
|
||||
device_description: "Verify the project builds from source on ESP32C6"
|
||||
external_components_source: github://syssi/esphome-votronic@main
|
||||
mac_address: 60:A4:23:91:8F:55
|
||||
|
||||
esphome:
|
||||
name: ${name}
|
||||
comment: ${device_description}
|
||||
min_version: 2024.6.0
|
||||
platformio_options:
|
||||
# board_build.f_cpu: 160000000L
|
||||
# board_build.f_flash: 80000000L
|
||||
board_build.flash_size: 8MB
|
||||
# build_flags: "-DBOARD_HAS_PSRAM"
|
||||
# board_build.arduino.memory_type: qio_opi
|
||||
|
||||
# Board is waveshare esp32-c6-devkit-n8
|
||||
esp32:
|
||||
board: esp32-c6-devkitc-1
|
||||
variant: esp32c6
|
||||
framework:
|
||||
type: esp-idf
|
||||
version: 5.3.1
|
||||
platform_version: 6.9.0
|
||||
sdkconfig_options:
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_8MB: y
|
||||
|
||||
external_components:
|
||||
- source: ${external_components_source}
|
||||
refresh: 0s
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
ota:
|
||||
platform: esphome
|
||||
|
||||
logger:
|
||||
level: VERY_VERBOSE
|
||||
|
||||
api:
|
||||
reboot_timeout: 0s
|
||||
|
||||
ble_client:
|
||||
- mac_address: ${mac_address}
|
||||
id: client0
|
||||
on_passkey_request:
|
||||
then:
|
||||
- ble_client.passkey_reply:
|
||||
id: client0
|
||||
passkey: 173928
|
||||
|
||||
votronic_ble:
|
||||
- ble_client_id: client0
|
||||
id: votronic0
|
||||
throttle: 5s
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
uart:
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: GPIO16
|
||||
rx_pin: GPIO17
|
||||
|
||||
votronic:
|
||||
- id: votronic1
|
||||
uart_id: uart_0
|
||||
rx_timeout: 150ms
|
||||
throttle: 2s
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
binary_sensor:
|
||||
- platform: votronic_ble
|
||||
votronic_ble_id: votronic0
|
||||
charging:
|
||||
name: "${name} charging"
|
||||
discharging:
|
||||
name: "${name} discharging"
|
||||
controller_active:
|
||||
name: "${name} controller active"
|
||||
current_reduction:
|
||||
name: "${name} current reduction"
|
||||
aes_active:
|
||||
name: "${name} aes active"
|
||||
|
||||
- platform: votronic
|
||||
votronic_id: votronic1
|
||||
charging:
|
||||
name: "${name} charging"
|
||||
discharging:
|
||||
name: "${name} discharging"
|
||||
controller_active:
|
||||
name: "${name} controller active"
|
||||
current_reduction:
|
||||
name: "${name} current reduction"
|
||||
aes_active:
|
||||
name: "${name} aes active"
|
||||
|
||||
sensor:
|
||||
- platform: votronic_ble
|
||||
votronic_ble_id: votronic0
|
||||
# Battery computer
|
||||
battery_voltage:
|
||||
name: "${name} battery voltage"
|
||||
secondary_battery_voltage:
|
||||
name: "${name} secondary battery voltage"
|
||||
battery_capacity_remaining:
|
||||
name: "${name} battery capacity remaining"
|
||||
state_of_charge:
|
||||
name: "${name} state of charge"
|
||||
current:
|
||||
name: "${name} current"
|
||||
power:
|
||||
name: "${name} power"
|
||||
battery_nominal_capacity:
|
||||
name: "${name} battery nominal capacity"
|
||||
|
||||
# Solar charger
|
||||
pv_voltage:
|
||||
name: "${name} pv voltage"
|
||||
pv_current:
|
||||
name: "${name} pv current"
|
||||
battery_status_bitmask:
|
||||
name: "${name} battery status bitmask"
|
||||
pv_controller_status_bitmask:
|
||||
name: "${name} pv controller status bitmask"
|
||||
charged_capacity:
|
||||
name: "${name} charged capacity"
|
||||
charged_energy:
|
||||
name: "${name} charged energy"
|
||||
pv_power:
|
||||
name: "${name} pv power"
|
||||
|
||||
- platform: votronic
|
||||
votronic_id: votronic1
|
||||
battery_voltage:
|
||||
name: "${name} battery voltage"
|
||||
secondary_battery_voltage:
|
||||
name: "${name} secondary battery voltage"
|
||||
current:
|
||||
name: "${name} current"
|
||||
power:
|
||||
name: "${name} power"
|
||||
state_of_charge:
|
||||
name: "${name} state of charge"
|
||||
controller_temperature:
|
||||
name: "${name} controller temperature"
|
||||
charging_mode_setting_id:
|
||||
name: "${name} charging mode setting id"
|
||||
battery_status_bitmask:
|
||||
name: "${name} battery status bitmask"
|
||||
charging_controller_status_bitmask:
|
||||
name: "${name} charging controller status bitmask"
|
||||
|
||||
text_sensor:
|
||||
- platform: votronic_ble
|
||||
votronic_ble_id: votronic0
|
||||
battery_status:
|
||||
name: "${name} battery status"
|
||||
pv_controller_status:
|
||||
name: "${name} pv controller status"
|
||||
|
||||
- platform: votronic
|
||||
votronic_id: votronic1
|
||||
charging_mode_setting:
|
||||
name: "${name} charging mode setting"
|
||||
battery_status:
|
||||
name: "${name} battery status"
|
||||
charging_controller_status:
|
||||
name: "${name} charging controller status"
|
Reference in New Issue
Block a user