@@ -10,6 +10,14 @@ permissions:
1010jobs :
1111 test :
1212 runs-on : ubuntu-latest
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ include :
17+ - ha : " 2025.12"
18+ constraints : constraints-ha2025.txt
19+ - ha : " 2026.1"
20+ constraints : constraints-ha2026.txt
1321 steps :
1422 - uses : actions/checkout@v4
1523 with :
@@ -18,28 +26,41 @@ jobs:
1826 - name : Set up Python
1927 uses : actions/setup-python@v5
2028 with :
21- python-version : " 3.13"
29+ python-version : " 3.13.11 "
2230 cache : " pip"
2331 cache-dependency-path : |
2432 requirements.test.txt
33+ constraints-ha2025.txt
34+ constraints-ha2026.txt
2535
2636 - name : Install test dependencies
2737 run : |
2838 python -m pip install --upgrade pip
29- pip install -r requirements.test.txt
3039
31- - name : Run tests with coverage
40+ python -c "import json; print('\\n'.join(json.load(open('custom_components/redsea/manifest.json'))['requirements']))" > /tmp/manifest_requirements.txt
41+ pip install -r /tmp/manifest_requirements.txt -c ${{ matrix.constraints }}
42+ pip install -r requirements.test.txt -c ${{ matrix.constraints }}
43+
44+ - name : Run tests with coverage (HA ${{ matrix.ha }})
45+ if : matrix.ha == '2026.1'
3246 run : |
3347 pytest -q \
3448 --cov=custom_components \
3549 --cov-report=term-missing \
3650 --cov-report=xml:coverage.xml
3751
52+ - name : Run tests (HA ${{ matrix.ha }})
53+ if : matrix.ha != '2026.1'
54+ run : |
55+ pytest -q
56+
3857 - name : Generate coverage badge (repo-local)
58+ if : matrix.ha == '2026.1'
3959 run : |
4060 python -m coverage_badge -o badges/coverage.svg -f
4161
4262 - name : Upload coverage.xml to Codecov
63+ if : matrix.ha == '2026.1'
4364 uses : codecov/codecov-action@v4
4465 with :
4566 files : coverage.xml
4869 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
4970
5071 - name : Commit updated badge
51- if : github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
72+ if : matrix.ha == '2026.1' && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
5273 run : |
5374 if git diff --quiet -- badges/coverage.svg; then
5475 echo "No badge changes"
0 commit comments