Skip to content

fix: resolve ty type-check error in _as_dict helper #31

fix: resolve ty type-check error in _as_dict helper

fix: resolve ty type-check error in _as_dict helper #31

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore: ["*.md", "docs/**", "LICENSE"]
pull_request:
branches: [main]
merge_group:
permissions:
contents: read
checks: write
pull-requests: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
commit-lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- run: uv sync --group dev
- run: uv run ruff check .
- run: uv run ruff format --check .
- name: Type check
run: uv run ty check
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.14"]
include:
- os: ubuntu-latest
python-version: "3.14"
coverage: true
name: "Test (${{ matrix.os }}, Python ${{ matrix.python-version }})"
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- run: uv python install ${{ matrix.python-version }}
- run: uv sync --group dev --python ${{ matrix.python-version }}
- name: Run tests
run: >-
uv run pytest --junit-xml=test-results.xml
${{ matrix.coverage && '--cov=custom_components --cov-report=xml --cov-fail-under=80' || '' }}
- name: Publish test report
if: always()
uses: dorny/test-reporter@v3
with:
name: "Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})"
path: test-results.xml
reporter: java-junit
- name: Write summary
if: always()
shell: bash
run: |
echo "## Test Results — ${{ matrix.os }}, Python ${{ matrix.python-version }}" >> "$GITHUB_STEP_SUMMARY"
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- run: uv build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
markdown:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: DavidAnson/markdownlint-cli2-action@v23
ci-pass:
if: always()
needs: [commit-lint, lint, test, build, markdown]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify all jobs passed
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "::error::One or more required jobs failed"
exit 1
fi
if [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "::error::One or more required jobs were cancelled"
exit 1
fi