Merge pull request #12 from hilman2/codex/release-1.11.2 #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # This workflow is the gate. It runs on every push, every PR, and is also | |
| # called by release.yml as a reusable workflow before a tag is published. | |
| # Branch protection on `main` requires every job below to pass. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_call: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint (black + ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install lint dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install black>=24.10.0 ruff>=0.7.0 | |
| - name: black --check | |
| run: black --check custom_components tests scripts | |
| - name: ruff check | |
| run: ruff check custom_components tests scripts | |
| hassfest: | |
| name: Hassfest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: home-assistant/actions/hassfest@master | |
| hacs: | |
| name: HACS validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: hacs/action@main | |
| with: | |
| category: integration | |
| test: | |
| name: Tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements_test.txt | |
| - name: Run pytest | |
| env: | |
| PY_COLORS: "1" | |
| run: pytest -n auto --cov=custom_components.xtool_s1 --cov-report=xml --cov-fail-under=100 | |
| - name: Upload coverage XML | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-xml-${{ matrix.python-version }} | |
| path: coverage.xml | |
| retention-days: 14 |