Skip to content

Commit d1372c4

Browse files
authored
Merge pull request #809 from LincolnPuzey/ci_improvements
Github actions CI maintenance and improvements
2 parents aa91cdf + 9f74649 commit d1372c4

File tree

4 files changed

+62
-25
lines changed

4 files changed

+62
-25
lines changed

.github/workflows/push.yml

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
11
name: CI
22
on: [push, pull_request]
33
jobs:
4-
lint:
5-
runs-on: ubuntu-24.04
6-
name: lint
4+
black:
5+
runs-on: ubuntu-latest
76
steps:
8-
- uses: actions/checkout@master
9-
- uses: actions/setup-python@v5
7+
- uses: actions/checkout@v6
8+
- uses: actions/setup-python@v6
109
with:
11-
python-version: "3.13"
12-
- run: |
13-
sudo apt-get update
14-
sudo apt-get remove libhashkit2 libmemcached11 || true
15-
sudo apt-get install -y libmemcached-dev
16-
- run: pip install tox
17-
- run: tox -e lint
18-
- run: tox -e docs
10+
python-version: "3.10"
11+
- run: pip install --group format
12+
- run: black --check .
13+
14+
mypy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
19+
with:
20+
python-version: "3.10"
21+
- run: pip install ".[all]" --group type-check
22+
- run: mypy
23+
24+
isort:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v6
28+
- uses: actions/setup-python@v6
29+
with:
30+
python-version: "3.10"
31+
- run: pip install --group lint
32+
- run: isort --check dramatiq tests
33+
34+
flake8:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: actions/setup-python@v6
39+
with:
40+
python-version: "3.10"
41+
- run: pip install --group lint
42+
- run: flake8 dramatiq tests examples
43+
44+
documentation:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v6
48+
- uses: actions/setup-python@v6
49+
with:
50+
python-version: "3.10"
51+
- run: pip install ".[all]" --group docs
52+
- run: cd docs && make html
1953

2054
build-unix:
2155
timeout-minutes: 30
@@ -47,9 +81,13 @@ jobs:
4781
ports:
4882
- 6379:6379
4983

84+
env:
85+
RABBITMQ_USERNAME: "dramatiq"
86+
RABBITMQ_PASSWORD: "dramatiq"
87+
5088
steps:
51-
- uses: actions/checkout@master
52-
- uses: actions/setup-python@v5
89+
- uses: actions/checkout@v6
90+
- uses: actions/setup-python@v6
5391
with:
5492
python-version: ${{ matrix.python }}
5593
- run: |
@@ -59,11 +97,5 @@ jobs:
5997
- run: pip install -e '.[all]' --group test
6098
- run: pytest --benchmark-skip
6199
if: ${{ matrix.concurrency == 'cpython' }}
62-
env:
63-
RABBITMQ_USERNAME: "dramatiq"
64-
RABBITMQ_PASSWORD: "dramatiq"
65100
- run: python pytest-gevent.py --benchmark-skip
66101
if: ${{ matrix.concurrency == 'gevent' }}
67-
env:
68-
RABBITMQ_USERNAME: "dramatiq"
69-
RABBITMQ_PASSWORD: "dramatiq"

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v5
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-python@v6
1414
with:
1515
python-version: "3.13"
1616

1717
- name: Install dependencies
18-
run: python -m pip install build
18+
run: pip install --group build
1919

2020
- name: Build dist packages
2121
run: python -m build .

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ To set up a development environment, it is recommended to:
2424
### Pull Requests
2525

2626
* Make sure any code changes are covered by tests.
27-
* Run [isort] and [black] on any modified files.
27+
* Run [black], [isort] and [flake8] on any modified files.
28+
* Run [mypy] to check type correctness.
2829
* If this is your first contribution, add yourself to the [CONTRIBUTORS] file.
2930
* If your branch is behind master, [rebase] on top of it.
3031

@@ -37,6 +38,8 @@ Run the test suite with `tox`. The tests require running [RabbitMQ],
3738
[Memcached]: https://memcached.org/
3839
[isort]: https://github.com/timothycrosley/isort
3940
[black]: https://github.com/psf/black
41+
[flake8]: https://flake8.pycqa.org/en/latest/
42+
[mypy]: https://mypy.readthedocs.io/en/stable/getting_started.html
4043
[rebase]: https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request
4144

4245

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ format = [
3232
]
3333
type-check = [
3434
"mypy",
35+
# Include test group so mypy can see the types of the pytest modules the tests import.
36+
{include-group = "test"},
3537
]
3638
build = [
3739
"build",

0 commit comments

Comments
 (0)