-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.69 KB
/
Copy pathcheck-python.yaml
File metadata and controls
54 lines (51 loc) · 1.69 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
name: Check - Python
on:
push:
branches: [master]
pull_request:
branches: [master]
paths:
- "updater/**/*.py"
- "schemas/**/*.py"
- "scripts/**/*.py"
- "site_plugins/**/*.py"
- "updater/pyproject.toml"
- ".github/workflows/check-python.yaml"
permissions:
contents: read
jobs:
python:
name: Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install formatting and linting tools
run: python -m pip install 'autopep8>=2.0.0' 'ruff>=0.12.0'
- name: Check formatting
id: formatting
run: |
python -m autopep8 --in-place --recursive --max-line-length 88 \
updater/src updater/tests schemas scripts site_plugins
git diff -- updater/src updater/tests schemas scripts site_plugins \
> formatting.diff
if [[ -s formatting.diff ]]; then
cat formatting.diff
echo "::error::Python formatting differs. Run: make format-python"
exit 1
fi
- name: Upload formatting diff
if: failure() && steps.formatting.outcome == 'failure'
uses: actions/upload-artifact@v7
with:
name: formatting-diff-${{ github.event.number }}-python
path: formatting.diff
if-no-files-found: error
retention-days: 7
- name: Lint
if: success() || steps.formatting.outcome == 'failure'
run: |
python -m ruff check updater/src updater/tests schemas scripts site_plugins
python -m compileall -q updater/src updater/tests schemas scripts site_plugins