-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (79 loc) · 2.42 KB
/
Copy pathtest.yml
File metadata and controls
99 lines (79 loc) · 2.42 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
name: Test
on:
push:
branches: [master, main, dev]
pull_request:
branches: [master, main, dev]
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
pip install pettracer-client==0.2.0
- name: Run tests with coverage
run: |
pytest --cov=custom_components.pettracer --cov-report=xml --cov-report=term -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Generate coverage report
run: |
pip install coverage
coverage report --fail-under=90
lint:
name: Lint and Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy
- name: Lint with ruff
run: |
ruff check custom_components/pettracer/ --output-format=github
continue-on-error: true
- name: Check formatting with ruff
run: |
ruff format --check custom_components/pettracer/
continue-on-error: true
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Validate manifest
run: |
python -c "import json; json.load(open('custom_components/pettracer/manifest.json'))"
- name: Validate strings.json
run: |
python -c "import json; json.load(open('custom_components/pettracer/strings.json'))"
- name: Validate translations
run: |
python -c "import json; json.load(open('custom_components/pettracer/translations/en.json'))"
- name: Check HACS compatibility
run: |
python -c "import json; json.load(open('hacs.json'))"