forked from benoitc/gunicorn
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (76 loc) · 2.7 KB
/
lint.yml
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
name: lint
on:
push:
paths-ignore:
- .github/appveyor.yml
# tags:
# - '*'
pull_request:
# on pull, automatic
workflow_dispatch:
# allow manual trigger
permissions:
contents: read # to fetch code (actions/checkout)
env:
# note that some tools care only for the name, not the value
FORCE_COLOR: 1
jobs:
lint:
name: ${{ matrix.toxenv }} / ${{ matrix.os }} / ${{ matrix.python-version }}
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes
timeout-minutes: 4
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toxenv: [lint, docs-lint, pycodestyle, format, mypy]
python-version: [ "3.10" ]
os: ["ubuntu-latest"]
include:
# this one is used for checking support/docs files
- os: ubuntu-latest
python-version: "3.10"
toxenv: null
# these ensure our lint-related tox runs can run on odd platforms
- os: windows-latest
python-version: "3.12"
toxenv: format
- os: macos-latest
python-version: "3.12"
toxenv: docs-lint
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Using Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "Install Dependencies (cache hit: ${{ steps.setup-python.outputs.cache-hit }})"
if: ${{ matrix.toxenv }}
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e ${{ matrix.toxenv }}
if: ${{ matrix.toxenv }}
- name: "Update docs"
if: ${{ ! matrix.toxenv }}
run: |
python -m pip install .[dev]
# this will update docs/source/settings.rst - but will not create html output
(cd docs && sphinx-build -b "dummy" -d _build/doctrees source "_build/dummy")
if unclean=$(git status --untracked-files=no --porcelain) && [ -z "$unclean" ]; then
echo "no uncommitted changes in working tree (as it should be)"
else
echo "did you forget to run `make -C docs html`?"
echo "$unclean"
exit 2
fi
- name: "Lint support files"
if: ${{ ! matrix.toxenv }}
env:
# annoying results for pl_PL and fr_FR.. still the only *obvious* choice
LC_ALL: C
run: |
tail +6 THANKS | sort --ignore-case --check
sort --check .gitignore