-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.5 KB
/
check-python.yml
File metadata and controls
64 lines (55 loc) · 1.5 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
# Source: https://github.com/per1234/.github/blob/main/workflow-templates/check-python.md
name: Check Python
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-python.ya?ml"
- "**/.flake8"
- "**/setup.cfg"
- "**/tox.ini"
- "**/poetry.lock"
- "**/pyproject.toml"
- "**.py"
pull_request:
paths:
- ".github/workflows/check-python.ya?ml"
- "**/.flake8"
- "**/setup.cfg"
- "**/tox.ini"
- "**/poetry.lock"
- "**/pyproject.toml"
- "**.py"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to flake8.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install flake8
run: |
python -m pip install --upgrade pip
python -m pip install --quiet flake8
python -m pip install --quiet pep8-naming
- name: Run flake8
run: python -m flake8 --show-source
formatting:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version-file: pyproject.toml
- name: Check formatting
uses: psf/black@stable