-
Notifications
You must be signed in to change notification settings - Fork 56
91 lines (86 loc) · 2.68 KB
/
Copy pathpytest.yaml
File metadata and controls
91 lines (86 loc) · 2.68 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
name: Python CI
on:
push:
branches: [beta, main]
paths:
- "**.py"
- "custom_components/**"
- "tests/**"
- "pyproject.toml"
- "requirements*.txt"
- ".github/workflows/pytest.yaml"
pull_request:
branches: [beta, main]
paths:
- "**.py"
- "custom_components/**"
- "tests/**"
- "pyproject.toml"
- "requirements*.txt"
- ".github/workflows/pytest.yaml"
schedule:
- cron: "0 7 1-28/7 * *"
jobs:
tests:
needs: prek
runs-on: ubuntu-latest
name: Pytest
strategy:
matrix:
python-version:
- "3.14"
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
- name: 🛠️ Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version }}
- name: 🚀 Install uv
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
- name: 📦 Install tox
run: uv pip install --system tox tox-gh-actions
- name: 🏃 Run tox
run: tox
- name: 📤 Upload coverage artifact
if: matrix.python-version == '3.14'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-data
path: coverage.xml
prek:
runs-on: ubuntu-latest
name: Prek
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 🛠️ Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "lts/iron"
- name: 📦 Install dependencies
run: yarn install
- name: 🔍 Run prek
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3
with:
extra-args: --all-files --skip no-commit-to-branch
coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
- name: 📥 Download coverage data
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: coverage-data
- name: 📤 Upload coverage report
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python
files: ./coverage.xml