Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ESPHome v2024.6.0 #25

Merged
merged 20 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Update Tags

# yamllint disable-line rule:truthy
on:
release:
types: [published]

jobs:
update-tags:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
with:
fetch-depth: '0'

- name: Set up Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

- name: Move and push stable tag
run: |
git tag -f stable ${{ github.event.release.tag_name }}
git push -f origin stable

- name: Move and push latest tag
run: |
git tag -f latest ${{ github.event.release.tag_name }}
git push -f origin latest
...
26 changes: 26 additions & 0 deletions .github/workflows/validate_clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Validate C++ (Clang Format)

# yamllint disable-line rule:truthy
on:
push:
paths:
- '**/*.h'
- '**/*.c'
- '**/*.cpp'
pull_request:
paths:
- '**/*.h'
- '**/*.c'
- '**/*.cpp'
workflow_dispatch:

jobs:
clang-format-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: RafikFarhad/clang-format-github-action@v3
with:
sources: "components/tx_ultimate_easy/*.h,components/tx_ultimate_easy/*.cpp"
...
116 changes: 116 additions & 0 deletions .github/workflows/validate_esphome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
name: Validate and Build ESPHome

# yamllint disable-line rule:truthy
on:
push:
paths:
- "*.yaml"
- "prebuilt/*.yaml"
- ".test/*.yaml"
- "*.h"
- "*.c"
- "*.cpp"
- "*.py"
pull_request:
paths:
- "*.yaml"
- "prebuilt/*.yaml"
- ".test/*.yaml"
- "*.h"
- "*.c"
- "*.cpp"
- "*.py"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
setup_dependencies:
name: Setup & Cache Dependencies
runs-on: ubuntu-latest
outputs:
cache-hit-arduino: ${{ steps.cache-arduino.outputs.cache-hit }}

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Cache Arduino Dependencies
id: cache-arduino
uses: actions/cache@main
with:
path: |
~/.esphome/cache
~/.platformio/packages
~/.platformio/platforms
key: ${{ runner.os }}-arduino-${{ hashFiles('**/esphome_ard_basic.yaml') }}
restore-keys: |
${{ runner.os }}-arduino-

code_scan:
name: Code scan (YAML)
runs-on: "ubuntu-latest"
needs: setup_dependencies
steps:
- name: Checkout Code
uses: actions/checkout@main

- name: Setup Python
uses: actions/setup-python@main
with:
python-version: '3.8'

- name: Install Yamllint
run: pip install yamllint

- name: Validate YAML files
run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} +

build_basic:
name: Basic
needs: [code_scan, setup_dependencies]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- id: ard
yaml_file: ".test/esphome_ard_basic.yaml"
cache-hit: ${{ needs.setup_dependencies.outputs.cache-hit-arduino }}

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Firmware
if: steps.matrix.outputs.cache-hit != 'true'
uses: esphome/[email protected]
with:
yaml_file: ${{ matrix.yaml_file }}

build_bluetooth_proxy:
name: Bluetooth Proxy
needs: build_basic
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: idf_v4
base: idf_v4
yaml_file: ".test/esphome_idf_bluetooth_proxy.yaml"
- id: idf_v5
base: idf_v5
yaml_file: ".test/esphome_idf5_bluetooth_proxy.yaml"

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Build Bluetooth Proxy Firmware
uses: esphome/[email protected]
with:
yaml_file: ${{ matrix.yaml_file }}
...
100 changes: 100 additions & 0 deletions .github/workflows/validate_esphome_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
name: Validate ESPHome (Beta)

# yamllint disable-line rule:truthy
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
setup_dependencies:
name: Setup & Cache Dependencies
runs-on: ubuntu-latest
outputs:
cache-hit-arduino: ${{ steps.cache-arduino.outputs.cache-hit }}

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Cache Arduino Dependencies
id: cache-arduino
uses: actions/cache@main
with:
path: |
~/.esphome/cache
~/.platformio/packages
~/.platformio/platforms
key: ${{ runner.os }}-arduino-${{ hashFiles('**/esphome_ard_basic.yaml') }}
restore-keys: |
${{ runner.os }}-arduino-

code_scan:
name: Code scan (YAML)
runs-on: "ubuntu-latest"
needs: setup_dependencies
steps:
- name: Checkout Code
uses: actions/checkout@main

- name: Setup Python
uses: actions/setup-python@main
with:
python-version: '3.8'

- name: Install Yamllint
run: pip install yamllint

- name: Validate YAML files
run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} +

build_basic:
name: Basic
needs: [code_scan, setup_dependencies]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- id: ard
yaml_file: ".test/esphome_ard_basic.yaml"
cache-hit: ${{ needs.setup_dependencies.outputs.cache-hit-arduino }}

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Firmware
if: steps.matrix.outputs.cache-hit != 'true'
uses: barndawgie/[email protected]
with:
yaml_file: ${{ matrix.yaml_file }}
version: beta

build_bluetooth_proxy:
name: Bluetooth Proxy
needs: build_basic
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: idf_v4
base: idf_v4
yaml_file: ".test/esphome_idf_bluetooth_proxy.yaml"
- id: idf_v5
base: idf_v5
yaml_file: ".test/esphome_idf5_bluetooth_proxy.yaml"

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Build Bluetooth Proxy Firmware
uses: barndawgie/[email protected]
with:
yaml_file: ${{ matrix.yaml_file }}
version: beta
...
58 changes: 58 additions & 0 deletions .github/workflows/validate_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Validate Markdown

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- '**/*.md'
push:
paths:
- '**/*.md'
workflow_dispatch:

jobs:
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
with:
fetch-depth: '0'

# https://github.com/marketplace/actions/markdownlint-cli2-action
- name: Identify changed files
uses: tj-actions/changed-files@v41
id: changed-files
with:
files: '**/*.md'
separator: ","
# https://github.com/marketplace/actions/markdownlint-cli2-action
- name: Markdown Lint
uses: DavidAnson/markdownlint-cli2-action@v14
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
separator: ","
config: '.rules/.markdownlint.jsonc'
fix: true

markdown-links:
name: Check links
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
with:
fetch-depth: '0'

# https://github.com/gaurav-nelson/github-action-markdown-link-check
- name: Markdown links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
# yamllint disable-line rule:truthy
check-modified-files-only: yes
config-file: '.rules/mlc_config.json'
base-branch: 'main'
...
30 changes: 30 additions & 0 deletions .github/workflows/validate_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Validate Python (flake8)

# yamllint disable-line rule:truthy
on:
push:
paths:
- '*.py'
pull_request:
paths:
- '*.py'
workflow_dispatch:

jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@main
- name: Set up Python environment
uses: actions/setup-python@main
with:
python-version: "3.11"
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
max-line-length: "200"
path: "components/tx_ultimate_easy"
...
Loading
Loading