-
Notifications
You must be signed in to change notification settings - Fork 69
130 lines (116 loc) · 3.41 KB
/
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Flake8
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_DB: pguser
POSTGRES_USER: pguser
POSTGRES_PASSWORD: foobar
options: >-
--health-cmd "pg_isready -U pguser"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_NAME: pguser
DATABASE_USER: pguser
DATABASE_PASSWORD: foobar
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 5432
REDIS_URL: redis://127.0.0.1:6379/0
strategy:
fail-fast: false
matrix:
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
# Exclusions for Django 3.2
- python-version: "3.11"
django-version: "3.2"
- python-version: "3.12"
django-version: "3.2"
# Exclusions for Django 4.0
- python-version: "3.6"
django-version: "4.0"
- python-version: "3.7"
django-version: "4.0"
- python-version: "3.11"
django-version: "4.0"
- python-version: "3.12"
django-version: "4.0"
# Exclusions for Django 4.1
- python-version: "3.6"
django-version: "4.1"
- python-version: "3.7"
django-version: "4.1"
# Exclusions for Django 4.2
- python-version: "3.6"
django-version: "4.2"
- python-version: "3.7"
django-version: "4.2"
# Exclusions for Django 5.0
- python-version: "3.6"
django-version: "5.0"
- python-version: "3.7"
django-version: "5.0"
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.0"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install django==${{ matrix.django-version }}
pip install -r requirements.txt
pip install psycopg2-binary
- name: Run migrations
run: |
python manage.py migrate
- name: Run tests
run: |
python manage.py test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flake8:
name: flake8
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip install --upgrade flake8
- name: flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8