New "lint" job in validate.yml runs ruff format --check, ruff check, and ty check against custom_components/ and tests/ on the same push/PR/schedule triggers as the existing hassfest/hacs/pytest jobs.
84 lines
1.8 KiB
YAML
84 lines
1.8 KiB
YAML
name: Validate
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
hassfest:
|
|
name: Hassfest validation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Run hassfest validation
|
|
uses: home-assistant/actions/hassfest@master
|
|
|
|
hacs:
|
|
name: HACS validation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Run HACS validation
|
|
uses: hacs/action@main
|
|
with:
|
|
category: integration
|
|
|
|
lint:
|
|
name: Lint, format, and type check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.14"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Run ruff format check
|
|
run: ruff format --check custom_components tests
|
|
|
|
- name: Run ruff lint
|
|
run: ruff check custom_components tests
|
|
|
|
- name: Run ty type check
|
|
run: ty check custom_components tests
|
|
|
|
tests:
|
|
name: Pytest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.14"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Run tests
|
|
run: pytest tests/ -q
|