-
Notifications
You must be signed in to change notification settings - Fork 14
92 lines (75 loc) · 2.21 KB
/
ci.yml
File metadata and controls
92 lines (75 loc) · 2.21 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
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install flake8
run: pip install flake8
- name: Run flake8
run: flake8 --ignore=E501,W503,E203 custom_components/cardata
- name: Run ruff linter (auto-fix)
if: github.event_name == 'push'
uses: astral-sh/ruff-action@v3
with:
args: "check --fix"
src: "custom_components/cardata"
- name: Run ruff linter (check)
if: github.event_name == 'pull_request'
uses: astral-sh/ruff-action@v3
with:
args: "check"
src: "custom_components/cardata"
- name: Run ruff formatter (auto-fix)
if: github.event_name == 'push'
uses: astral-sh/ruff-action@v3
with:
args: "format"
src: "custom_components/cardata"
- name: Run ruff formatter check
if: github.event_name == 'pull_request'
uses: astral-sh/ruff-action@v3
with:
args: "format --check"
src: "custom_components/cardata"
- name: Commit ruff fixes
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: ruff autofix"
typecheck:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: mypy --namespace-packages --explicit-package-bases --ignore-missing-imports custom_components/cardata
compile:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Compile all
run: python -m compileall custom_components/cardata