Доработки после первой реальной проверки #5
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: YAML lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install yamllint | |
| run: pip install yamllint | |
| - name: Lint YAML sources | |
| run: yamllint -c .yamllint.yaml blueprints/ .github/ .yamllint.yaml | |
| test: | |
| name: Tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: requirements-dev.txt | |
| - name: Install development dependencies | |
| run: pip install -r requirements-dev.txt | |
| - name: Run the test suite | |
| run: pytest -v -m "not slow" | |
| mutation: | |
| name: Mutation testing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: requirements-dev.txt | |
| - name: Install development dependencies | |
| run: pip install -r requirements-dev.txt | |
| # Corrupts one part of the blueprint at a time and asserts the suite | |
| # notices. A green suite that survives a mutation is a vacuous suite. | |
| - name: Verify the suite detects a broken blueprint | |
| run: pytest -v -m slow | |
| ruff: | |
| name: Python lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: Lint the test harness and tools | |
| run: ruff check tests/ tools/ | |
| home-assistant-schema: | |
| name: Home Assistant schema (informational) | |
| runs-on: ubuntu-latest | |
| # Home Assistant's internal APIs carry no stability promise, so a failure | |
| # here is a signal to investigate rather than a reason to block a merge. | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Home Assistant | |
| run: pip install homeassistant | |
| - name: Validate the blueprint against the real schema | |
| run: python tests/validate_with_home_assistant.py |