forked from coagulant/django-whatever
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (65 loc) · 1.83 KB
/
tests-and-codestyle.yaml
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
name: Tests and codestyle
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10]
django: [2.2.*, 3.1.*, 3.2.*]
exclude:
- python: 3.5
django: 3.1.*
- python: 3.5
django: 3.2.*
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-tests|${{ matrix.python }}|${{ matrix.django }}
- run: pip install -r tests/requirements.txt
- run: pip install -U Django==${{ matrix.django }}
- run: pip install -U -e .
- run: python tests/manage.py test testapp
codestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-codestyle
- run: pip install -U flake8 isort
- run: flake8
- run: isort --check-only .