-
Notifications
You must be signed in to change notification settings - Fork 77
53 lines (42 loc) · 1.33 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
name: Linting
on:
pull_request:
paths:
- 'geotrek/**' # if geotrek code change
- '.github/workflows/lint.yml' # if lint workflow change
- 'dev-requirements.txt' # if dev-requirements.txt change
- 'setup.cfg' # if lint tools configuration change
env:
DEBIAN_FRONTEND: noninteractive
jobs:
flake8:
name: Checking Flake8 rules
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04']
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
- name: Not evaluated values in migration files
run: |
test $(ls geotrek/*/migrations/*.py | xargs grep -l srid | xargs grep -L SRID | wc -l) -eq 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.wheel_dir
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 wheel --wheel-dir=~/.wheel_dir flake8 -c dev-requirements.txt
pip3 install --find-links=~/.wheel_dir --upgrade flake8 -c dev-requirements.txt
- name: Flake8
run: |
flake8 geotrek