Skip to content

Merge pull request #5 from ngoviet/audit/robustness-and-thread-safety #5

Merge pull request #5 from ngoviet/audit/robustness-and-thread-safety

Merge pull request #5 from ngoviet/audit/robustness-and-thread-safety #5

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "17 4 * * 1"
jobs:
lint:
name: Lint and type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install ruff
run: pip install "ruff==0.15.22"
- name: Ruff
run: ruff check .
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
# aiohttp, crcmod and paho-mqtt are manifest.json runtime
# requirements: the suite loads core/api_client.py,
# core/realtime_parser.py and core/mqtt_client.py by path, and each
# imports its transport at module scope, so the API-client tests fail
# to import without them even though no test opens a real connection.
pip install pytest pytest-asyncio "aiohttp>=3.8.0" "paho-mqtt>=1.6.0" "crcmod>=1.7"
- name: Run tests
run: pytest tests/ -v
hassfest:
name: Hassfest
runs-on: ubuntu-latest
steps:
# hassfest compares manifest["domain"] against the *integration
# directory name*, and has no notion of hacs.json's content_in_root.
# This repo deliberately keeps the integration at the repository root
# (hacs.json "content_in_root": true), so a plain checkout presents
# hassfest with a directory named after the runner workspace and the
# domain check can never pass. Checking out into custom_components/,
# the layout hassfest expects, gives it a directory whose name matches
# the domain. This only relocates the checkout: the mounted workspace
# and the set of files hassfest validates are unchanged.
- uses: actions/checkout@v5
with:
path: custom_components/lumentree
- uses: home-assistant/actions/hassfest@master
hacs:
name: HACS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: hacs/action@main
with:
category: integration