forked from cherrypy/cheroot
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (73 loc) · 2.36 KB
/
python-linters.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
77
name: Code quality
on:
push:
pull_request:
schedule:
# Run every Friday at 18:02 UTC
# https://crontab.guru/#2_18_*_*_5
- cron: 2 18 * * 5
jobs:
linters:
runs-on: ${{ matrix.os }}
strategy:
# max-parallel: 5
matrix:
python-version:
- 3.8
os:
- ubuntu-latest
toxenv:
- pre-commit
# - pre-commit-failing
- setup-check
- build-docs
- spellcheck-docs
- linkcheck-docs
env:
TOX_PARALLEL_NO_SPINNER: 1
TOXENV: ${{ matrix.toxenv }}
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pre-commit cache
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('setup.cfg') }}-${{ hashFiles('setup.py') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('.pre-commit-config.yaml.failing') }}-${{ hashFiles('pytest.ini') }}
restore-keys: |
${{ runner.os }}-pre-commit-
${{ runner.os }}-
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}-${{ hashFiles('setup.py') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('.pre-commit-config.yaml.failing') }}-${{ hashFiles('pytest.ini') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install tox
run: |
python -m pip install --upgrade tox
- name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}'
run: >-
python -m
tox
--parallel auto
--parallel-live
-vv
--skip-missing-interpreters false
--notest
- name: Initialize pre-commit envs if needed
run: |
test -d .tox/pre-commit && .tox/pre-commit/bin/python -m pre_commit install-hooks || :
test -d .tox/pre-commit-failing && .tox/pre-commit-failing/bin/python -m pre_commit install-hooks || :
- name: Test with tox
run: >-
python -m
tox
--parallel auto
--parallel-live
-vv