Skip to content

Commit 0154314

Browse files
committed
Update CI suite
1 parent ee52b81 commit 0154314

File tree

4 files changed

+70
-60
lines changed

4 files changed

+70
-60
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,53 @@ on:
88

99
jobs:
1010

11-
black:
11+
lint:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
lint-command:
16+
- bandit -r . -x ./tests
17+
- black --check --diff .
18+
- flake8 .
19+
- isort --check-only --diff .
20+
- pydocstyle .
1321
steps:
1422
- uses: actions/checkout@v3
1523
- uses: actions/setup-python@v4
1624
with:
17-
python-version: "3.10"
18-
- run: python -m pip install black
19-
- run: black --check --diff .
25+
python-version: "3.x"
26+
cache: 'pip'
27+
cache-dependency-path: 'linter-requirements.txt'
28+
- run: python -m pip install -r linter-requirements.txt
29+
- run: ${{ matrix.lint-command }}
2030

2131
docs:
2232
runs-on: ubuntu-latest
2333
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/setup-python@v4
26-
with:
27-
python-version: "3.10"
28-
- run: sudo apt install -y python3-enchant graphviz
29-
- run: python -m pip install --upgrade pip setuptools
30-
- run: pip install sphinxcontrib-spelling
31-
- run: pip install -e '.[docs]'
32-
- run: python setup.py build_sphinx -W -b spelling
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-python@v4
36+
with:
37+
python-version: "3.10"
38+
- run: sudo apt install -y python3-enchant graphviz
39+
- run: python -m pip install sphinxcontrib-spelling
40+
- run: python -m pip install -e '.[docs]'
41+
- run: python -m sphinx -W -b spelling docs docs/_build
3342

3443
dist:
3544
runs-on: ubuntu-latest
3645
steps:
3746
- uses: actions/checkout@v3
3847
- uses: actions/setup-python@v4
3948
with:
40-
python-version: "3.10"
41-
- run: python -m pip install --upgrade pip setuptools wheel twine readme-renderer
42-
- run: python setup.py sdist bdist_wheel
49+
python-version: "3.x"
50+
- run: python -m pip install --upgrade pip build wheel twine readme-renderer
51+
- run: python -m build --sdist --wheel
4352
- run: python -m twine check dist/*
4453

45-
pytest:
54+
PyTest:
4655
needs:
4756
- dist
57+
- lint
4858
runs-on: ubuntu-latest
4959
strategy:
5060
matrix:
@@ -53,38 +63,28 @@ jobs:
5363
- "3.9"
5464
- "3.10"
5565
django-version:
56-
- "2.2a"
57-
- "3.2a"
58-
- "4.0a"
59-
steps:
60-
- uses: actions/checkout@v3
61-
- uses: actions/setup-python@v4
62-
with:
63-
python-version: ${{ matrix.python-version }}
64-
- run: sudo apt install -y graphviz redis-server
65-
- run: python -m pip install --upgrade pip setuptools wheel codecov
66-
- run: python -m pip install -e .[dramatiq]
67-
- run: python -m pip install "django~=${{ matrix.django-version }}"
68-
- run: python setup.py test
69-
- run: codecov
70-
71-
extras:
72-
needs:
73-
- dist
74-
runs-on: ubuntu-latest
75-
strategy:
76-
matrix:
66+
- "2.2"
67+
- "3.2"
68+
- "4.0"
7769
extras:
78-
- dramatiq
79-
- celery
80-
- dramatiq,reversion
70+
- "test"
71+
include:
72+
- python-version: "3.x"
73+
django-version: "4.0"
74+
extras: "test,dramatiq"
75+
- python-version: "3.x"
76+
django-version: "4.0"
77+
extras: "test,celery"
78+
- python-version: "3.x"
79+
django-version: "4.0"
80+
extras: "test,reversion"
8181
steps:
8282
- uses: actions/checkout@v3
8383
- uses: actions/setup-python@v4
8484
with:
85-
python-version: "3.10"
86-
- run: sudo apt-get install -y graphviz redis-server
87-
- run: python -m pip install --upgrade pip setuptools wheel codecov
85+
python-version: ${{ matrix.python-version }}
86+
- run: sudo apt install -y graphviz redis-server
87+
- run: python -m pip install "django==${{ matrix.django-version }}.*"
8888
- run: python -m pip install -e .[${{ matrix.extras }}]
89-
- run: python setup.py test
90-
- run: codecov
89+
- run: python -m pytest
90+
- uses: codecov/codecov-action@v2

.github/workflows/release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ on:
55
types: [published]
66

77
jobs:
8-
PyPI:
8+
9+
PyPi:
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v3
1213
- uses: actions/setup-python@v4
1314
with:
14-
python-version: "3.10"
15-
- name: Install Python dependencies
16-
run: python -m pip install --upgrade pip setuptools wheel twine
17-
- name: Build dist packages
18-
run: python setup.py sdist bdist_wheel
19-
- name: Upload packages
20-
run: python -m twine upload dist/*
15+
python-version: "3.x"
16+
- run: python -m pip install --upgrade pip build wheel twine
17+
- run: python -m build --sdist --wheel
18+
- run: python -m twine upload dist/*
2119
env:
2220
TWINE_USERNAME: __token__
2321
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

linter-requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bandit==1.7.4
2+
black==22.8.0
3+
flake8==5.0.4
4+
isort==5.10.1
5+
pydocstyle[toml]==6.1.1

setup.cfg

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ keywords =
4242
task
4343

4444
[options]
45+
python_requires = >=3.7
4546
include_package_data = True
4647
packages = joeflow
4748
install_requires =
@@ -60,19 +61,25 @@ tests_require =
6061
redis
6162

6263
[options.extras_require]
64+
test =
65+
pytest
66+
pytest-cov
67+
pytest-django
68+
pytest-env
69+
redis
70+
docs =
71+
celery>=4.2.0
72+
django-reversion
73+
dramatiq
74+
django_dramatiq
75+
redis
6376
reversion =
6477
django-reversion
6578
celery =
6679
celery>=4.2.0
6780
dramatiq =
6881
dramatiq<=1.12.0
6982
django_dramatiq
70-
docs =
71-
celery>=4.2.0
72-
django-reversion
73-
dramatiq
74-
django_dramatiq
75-
redis
7683

7784
[bdist_wheel]
7885
universal = 1

0 commit comments

Comments
 (0)