@@ -13,33 +13,32 @@ jobs:
1313 fail-fast : false
1414 matrix :
1515 lint-command :
16- - " bandit -r mailauth -x tests"
17- - " black --check --diff ."
18- - " flake8 ."
19- - " isort --check-only --diff ."
20- - " pydocstyle ."
16+ - bandit -r . -x ./ tests
17+ - black --check --diff .
18+ - flake8 .
19+ - isort --check-only --diff .
20+ - pydocstyle .
2121 runs-on : ubuntu-latest
2222 steps :
2323 - uses : actions/checkout@v3
2424 - uses : actions/setup-python@v4
2525 with :
2626 python-version : " 3.x"
27- cache : ' pip'
28- cache-dependency-path : ' requirements.txt'
29- - run : python -m pip install -r requirements.txt
27+ cache : pip
28+ cache-dependency-path : linter- requirements.txt
29+ - run : python -m pip install -r linter- requirements.txt
3030 - run : ${{ matrix.lint-command }}
3131
3232 dist :
3333 runs-on : ubuntu-latest
3434 steps :
35- - run : sudo apt install -y gettext
35+ - uses : actions/checkout@v3
3636 - uses : actions/setup-python@v4
3737 with :
3838 python-version : " 3.x"
39- - uses : actions/checkout@v3
4039 - name : Install Python dependencies
41- run : python -m pip install --upgrade pip setuptools wheel twine readme-renderer
42- - run : python setup.py sdist bdist_wheel
40+ run : python -m pip install --upgrade pip build wheel twine readme-renderer
41+ - run : python -m build -- sdist --wheel
4342 - run : python -m twine check dist/*
4443 - uses : actions/upload-artifact@v3
4544 with :
@@ -51,16 +50,14 @@ jobs:
5150 - uses : actions/checkout@v3
5251 - uses : actions/setup-python@v4
5352 with :
54- python-version : " 3.x"
55- cache : ' pip'
56- cache-dependency-path : ' requirements.txt'
57- - run : python -m pip install --upgrade pip setuptools wheel
58- - run : python -m pip install -r requirements.txt
59- - run : python setup.py develop
60- - run : python setup.py build_sphinx -W
53+ python-version : " 3.11"
54+ - run : sudo apt install -y python3-enchant
55+ - run : python -m pip install sphinxcontrib-spelling
56+ - run : python -m pip install -e '.[docs]'
57+ - run : python -m sphinx -W -b spelling docs docs/_build
6158
6259 SQLite :
63- needs : [lint, dist, docs]
60+ needs : [ lint, dist, docs ]
6461 runs-on : ubuntu-latest
6562 strategy :
6663 matrix :
@@ -69,50 +66,48 @@ jobs:
6966 - " 3.10"
7067 - " 3.11"
7168 steps :
72- - name : Set up Python ${{ matrix.python-version }}
73- uses : actions/setup-python@v4
69+ - uses : actions/checkout@v3
70+ - uses : actions/setup-python@v4
7471 with :
7572 python-version : ${{ matrix.python-version }}
76- - run : python -m pip install --upgrade pip setuptools wheel
77- - uses : actions/checkout@v3
78- - run : python setup.py test
79- - name : Codecov
80- run : |
81- python -m pip install codecov
82- codecov
73+ - run : python -m pip install -e '.[test]'
74+ - run : python -m pytest
75+ - uses : codecov/codecov-action@v2
76+ with :
77+ flags : ${{ matrix.python-version }}
8378
84- extras :
85- needs : [lint, dist, docs]
79+ contrib :
80+ needs : [ lint, dist, docs ]
8681 runs-on : ubuntu-latest
8782 strategy :
8883 matrix :
8984 extras :
9085 - wagtail
91- python-version : ["3.x"]
86+ python-version : [ "3.x" ]
9287 steps :
88+ - uses : actions/checkout@v3
9389 - name : Set up Python ${{ matrix.python-version }}
9490 uses : actions/setup-python@v4
9591 with :
9692 python-version : ${{ matrix.python-version }}
97- - run : python -m pip install --upgrade pip setuptools wheel
98- - uses : actions/checkout@v3
99- - run : python -m pip install -e ".[${{ matrix.extras }}]"
100- - run : python setup.py test
101- - name : Codecov
102- run : |
103- python -m pip install codecov
104- codecov
93+ - run : python -m pip install -e ".[test,${{ matrix.extras }}]"
94+ - run : python -m pytest
95+ - uses : codecov/codecov-action@v2
96+ with :
97+ flags : ${{ matrix.extras }}
10598
10699
107100 PostgreSQL :
108- needs : [lint, dist, docs]
101+ needs : [ lint, dist, docs ]
109102 runs-on : ubuntu-latest
110103 strategy :
111104 matrix :
112- python-version : ["3.10"]
105+ python-version : [ "3.10" ]
113106 django-version :
114107 - " 4.0"
115108 - " 4.1"
109+ extras :
110+ - postgres
116111 services :
117112 postgres :
118113 image : postgres
@@ -127,21 +122,19 @@ jobs:
127122 uses : actions/setup-python@v4
128123 with :
129124 python-version : ${{ matrix.python-version }}
130- - run : python -m pip install --upgrade pip setuptools wheel
131125 - uses : actions/checkout@v3
132- - run : python -m pip install "psycopg2-binary<2.9" Django~=${{ matrix.django-version }}.0
133- - run : python setup.py test
126+ - run : python -m pip install Django~=${{ matrix.django-version }}.0 -e ".[test,${{ matrix.extras }}]"
127+ - run : python -m pytest
134128 env :
135129 DB_PORT : ${{ job.services.postgres.ports[5432] }}
136130 DB : pg
137- - name : Codecov
138- run : |
139- python -m pip install codecov
140- codecov
131+ - uses : codecov/codecov-action@v2
132+ with :
133+ flags : ${{ matrix.extras }}
141134
142135 analyze :
143136 name : CodeQL
144- needs : [SQLite, extras , PostgreSQL]
137+ needs : [ SQLite, contrib , PostgreSQL ]
145138 runs-on : ubuntu-latest
146139 permissions :
147140 actions : read
0 commit comments