-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.3 KB
/
linting.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
name: Linting
on:
push:
pull_request:
schedule:
# Run every Friday at 18:02 UTC
- cron: 2 18 * * 5
jobs:
lint:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
env:
TOXENV: lint,docs,vendoring
strategy:
matrix:
os:
- Ubuntu
- Windows
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
# Setup Caching
- name: pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Set PY (for pre-commit cache)
run: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- name: pre-commit cache
uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
# Get the latest tox
- name: Install tox
run: python -m pip install tox
# Main check
- run: python -m tox