-
Notifications
You must be signed in to change notification settings - Fork 114
102 lines (86 loc) · 2.37 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
93
94
95
96
97
98
99
100
101
102
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.12'
- uses: pre-commit/action@v3.0.1
tests:
name: Run tests (${{ matrix.tox-env }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tox-env: type
python-version: '3.12'
- tox-env: 2024_4
python-version: '3.12'
- tox-env: 2024_5
python-version: '3.12'
- tox-env: 2024_6
python-version: '3.12'
- tox-env: 2024_7
python-version: '3.12'
- tox-env: 2024_8
python-version: '3.12'
- tox-env: 2024_9
python-version: '3.12'
- tox-env: 2024_10
python-version: '3.12'
- tox-env: 2024_11
python-version: '3.12'
latest: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Load ~/.local cache
uses: actions/cache@v4
with:
path: ~/.local
key: dotlocal-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Load virtual environment cache
uses: actions/cache@v4
with:
path: |
.venv
.tox
key: venv-${{ hashFiles('pyproject.toml', 'poetry.lock') }}-${{ matrix.tox-env }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: '1.8.3'
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
- name: Install dependencies
run: poetry install --only tox
- name: Run tests
run: poetry run tox -e ${{ matrix.tox-env }}
- name: Upload coverage report
if: ${{ matrix.latest == true }}
uses: codecov/codecov-action@v4
with:
files: .tox/${{ matrix.tox-env }}/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
validate:
name: Validate for HACS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: HACS validation
uses: hacs/action@main
with:
category: integration