-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (80 loc) · 2.33 KB
/
ci.yml
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
name: CI
on:
push:
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
tests:
name: Run tests (${{ matrix.ha-version }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ha-version: '2023.9'
python-version: '3.11'
- ha-version: '2023.10'
python-version: '3.11'
- ha-version: '2023.11'
python-version: '3.11'
- ha-version: '2023.12'
python-version: '3.11'
- ha-version: '2024.1'
python-version: '3.11'
- ha-version: '2024.1'
python-version: '3.11'
- ha-version: '2024.2'
python-version: '3.12'
- ha-version: '2024.4'
python-version: '3.12'
- ha-version: '2024.5'
python-version: '3.12'
- ha-version: '2024.6'
python-version: '3.12'
- ha-version: '2024.7'
python-version: '3.12'
- ha-version: '2024.8'
python-version: '3.12'
- ha-version: '2024.9'
python-version: '3.12'
- ha-version: '2024.10'
python-version: '3.12'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: tests/requirements_${{ matrix.ha-version }}.txt
- name: Install dependencies
run: |
pip install -r tests/requirements_${{ matrix.ha-version }}.txt
# https://github.com/python/mypy/issues/8545
- name: Fix homeassistant type checking
run: |
python -c 'from pathlib import Path; import homeassistant; (Path(homeassistant.__file__).parent / Path("py.typed")).touch()'
- name: Type checking
run: mypy .
- name: Test with pytest
run: pytest
validate:
name: Validate for HACS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: HACS validation
uses: hacs/action@main
with:
category: integration
ignore: brands