@@ -14,10 +14,21 @@ jobs:
1414 tests :
1515 runs-on : ubuntu-latest
1616 timeout-minutes : 10
17+ env :
18+ PYTHONPATH : " ."
1719 strategy :
1820 matrix :
19- python-version : [3.8, 3.9, "3.10", 3.11-dev]
20-
21+ # https://github.com/actions/python-versions/blob/main/versions-manifest.json
22+ python-version : [3.8, 3.9, "3.10", 3.11.0-beta.5]
23+ django-version :
24+ - " Django>=3.2,<4.0"
25+ - " Django>=4.0,<4.1"
26+ - " Django>=4.1,<4.2"
27+ - " https://github.com/django/django/archive/main.tar.gz"
28+ include :
29+ - drf : djangorestframework
30+ python-version : " 3.10"
31+ django-version : " Django<4.2,>=4.1" # must be different from django-version
2132 steps :
2233 - uses : actions/checkout@v3
2334 - uses : actions/setup-python@v4
@@ -30,14 +41,33 @@ jobs:
3041 if : endsWith(matrix.python-version, '-dev')
3142 with :
3243 python-version : ${{ matrix.python-version }}
33- - name : Install Tox
34- run : python -m pip install tox tox-gh-actions
35- - name : Run Tox
36- run : python -m tox
44+ - name : Install deps
45+ run : |
46+ python -m pip install -e .[test]
47+ python -m pip install "${{ matrix.django-version }}" ${{ matrix.drf }}
48+ - run : pytest
49+
50+ lint :
51+ runs-on : ubuntu-latest
52+ timeout-minutes : 10
53+ env :
54+ PYTHONPATH : " ."
55+ steps :
56+ - uses : actions/checkout@v3
57+ - uses : actions/setup-python@v4
58+ with :
59+ python-version : " 3.10"
60+ cache : ' pip'
61+ cache-dependency-path : ' setup.cfg'
62+ - uses : actions/cache@v3
63+ with :
64+ path : ~/.cache/pre-commit
65+ key : pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
66+ - run : python -m pip install -e .[dev]
67+ - run : pre-commit run --show-diff-on-failure --color=always --all-files
3768
3869 package :
3970 runs-on : ubuntu-latest
40- needs : tests
4171 timeout-minutes : 5
4272 steps :
4373 - uses : actions/checkout@v3
6292
6393 publish :
6494 runs-on : ubuntu-latest
65- needs : [tests, package ]
95+ needs : [package, tests, lint ]
6696 if : startsWith(github.ref, 'refs/tags/v')
6797 timeout-minutes : 5
6898 steps :
@@ -113,4 +143,4 @@ jobs:
113143 release_name : Release ${{ steps.release_output.outputs.VERSION }}
114144 body : ${{ steps.release_output.outputs.BODY }}
115145 draft : false
116- prerelease : false
146+ prerelease : ${{ contains(steps.release_output.outputs.VERSION, 'rc') || contains(steps.release_output.outputs.VERSION, 'b') || contains(steps.release_output.outputs.VERSION, 'b') }}
0 commit comments