EVC: fix segmented-register reads (vendor-confirmed); firmware-version gating; doc-aligned entities #1061
Workflow file for this run
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/CD Integrated | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Run pre-commit checks | |
| run: uv run pre-commit run --all-files --show-diff-on-failure | |
| mypy: | |
| name: Type Check (mypy) | |
| needs: [quality] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Run mypy type checking | |
| run: | | |
| echo "Running mypy in strict mode..." | |
| uv run mypy custom_components/solax_modbus tests --strict | |
| hacs: | |
| name: HACS Validation | |
| needs: [quality] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: HACS Action | |
| uses: hacs/action@main | |
| with: | |
| category: integration | |
| hassfest: | |
| name: Hassfest Validation | |
| needs: [quality] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Hassfest Action | |
| uses: home-assistant/actions/hassfest@master | |
| test-quick: | |
| name: Test Quick | |
| needs: [mypy] | |
| if: github.event_name == 'push' && github.ref != 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Run Quick Tests | |
| run: uv run pytest -m "not slow" | |
| test-comprehensive: | |
| name: Test Comprehensive | |
| needs: [mypy] | |
| if: github.event_name == 'pull_request' || github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Run Full Tests | |
| run: uv run pytest | |
| all-checks-passed: | |
| name: ✅ All Checks Passed | |
| if: always() | |
| needs: [hacs, hassfest, test-quick, test-comprehensive] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check all results | |
| run: | | |
| HACS="${{ needs.hacs.result }}" | |
| HASSFEST="${{ needs.hassfest.result }}" | |
| QUICK="${{ needs.test-quick.result }}" | |
| COMPREHENSIVE="${{ needs.test-comprehensive.result }}" | |
| echo "HACS: $HACS" | |
| echo "Hassfest: $HASSFEST" | |
| echo "Quick Tests: $QUICK" | |
| echo "Comprehensive Tests: $COMPREHENSIVE" | |
| # 1. Static Analysis must pass | |
| if [[ "$HACS" != "success" ]]; then | |
| echo "❌ HACS validation failed" | |
| exit 1 | |
| fi | |
| if [[ "$HASSFEST" != "success" ]]; then | |
| echo "❌ Hassfest validation failed" | |
| exit 1 | |
| fi | |
| # 2. Tests: One path must succeed | |
| if [[ "$COMPREHENSIVE" == "success" ]]; then | |
| echo "✅ Comprehensive tests passed" | |
| exit 0 | |
| elif [[ "$QUICK" == "success" && "$COMPREHENSIVE" == "skipped" ]]; then | |
| echo "✅ Quick tests passed" | |
| exit 0 | |
| elif [[ "$QUICK" == "skipped" && "$COMPREHENSIVE" == "skipped" ]]; then | |
| echo "⚠️ No tests ran?" | |
| exit 1 | |
| else | |
| echo "❌ Tests failed or cancelled" | |
| exit 1 | |
| fi |