-
Notifications
You must be signed in to change notification settings - Fork 12
117 lines (98 loc) · 3.75 KB
/
Copy pathci.yml
File metadata and controls
117 lines (98 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
# main is included because releases are cut from it: the tag is created on
# main through the GitHub UI and release.yml builds the shipped ZIP from
# that tag. Without main here, the merge commit that reaches users is
# never tested as it ships — only as a pull request, before the merge.
branches: ["main", "dev", "feature/**", "fix/**", "hotfix/**"]
tags-ignore: ["**"]
pull_request:
branches: [dev, main]
# pytest-homeassistant-custom-component is deliberately unpinned, so the
# suite tracks whatever Home Assistant is current. That means a Home
# Assistant release can break this integration without anyone touching the
# repository — the weekly run surfaces it instead of the next contributor.
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: Lint & pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
cache: pip
- name: Install dependencies
run: pip install pre-commit mypy -r requirements.txt
- name: Cache pre-commit hooks
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files
# The pre-commit hook above type checks against homeassistant-stubs; this
# run uses the real homeassistant package from requirements.txt, which
# catches what the stubs leave as Incomplete.
- name: Run mypy
run: mypy custom_components/simple_pid_controller/
test:
# Home Assistant's supported Python floor decides which Home Assistant
# version pip can install. On 3.13 the newest resolvable release is
# 2026.2.3, because Home Assistant 2026.3 onwards requires Python 3.14.2.
# Testing only on 3.13 therefore validates against a Home Assistant that
# is months behind what users run, without saying so anywhere.
#
# 3.14 is the version that matters; 3.13 is kept so the older supported
# Home Assistant line does not silently break.
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
# Which Home Assistant a green run actually proves compatibility with is
# otherwise invisible, since the dependency is unpinned by design.
- name: Report the resolved Home Assistant version
run: |
HA_VERSION=$(pip show homeassistant | awk '/^Version:/ {print $2}')
echo "Python ${{ matrix.python-version }} resolved Home Assistant $HA_VERSION"
echo "- Python \`${{ matrix.python-version }}\` → Home Assistant \`$HA_VERSION\`" >> "$GITHUB_STEP_SUMMARY"
- name: Run pytest
run: pytest --cov=custom_components --cov-report=xml -q
- name: Upload coverage
uses: codecov/codecov-action@v7
with:
files: ./coverage.xml
fail_ci_if_error: false
hacs:
name: HACS validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: hacs/action@main
with:
category: integration
hassfest:
name: Home Assistant hassfest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: home-assistant/actions/hassfest@master