Skip to content

Commit 5ec0299

Browse files
committed
Make tests run in parallel
1 parent a10622c commit 5ec0299

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

.github/workflows/python-app.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,64 @@ on:
1212
permissions:
1313
contents: read
1414

15-
jobs:
16-
build:
15+
env:
16+
# Bunching all the dependencies together is probably friendlier
17+
TEST_DEPS: ruff mypy pytest
1718

19+
jobs:
20+
ruff:
1821
runs-on: ubuntu-latest
19-
2022
steps:
2123
- uses: actions/checkout@v4
2224
- name: Set up Python 3.12
2325
uses: actions/setup-python@v3
2426
with:
2527
python-version: "3.12"
28+
cache: 'pip' # Will cache miss in parallel first time, but then we should save a lot of time on builds
2629
- name: Install dependencies
2730
run: |
2831
python -m pip install --upgrade pip
29-
pip install ruff mypy pytest
32+
pip install $TEST_DEPS
3033
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3134
- name: Lint with ruff
3235
run: |
3336
# stop the build if there are Python syntax errors or undefined names
3437
ruff check . --select=E9,F63,F7,F8 --statistics
3538
# exit-zero treats all errors as warnings.
3639
ruff check . --exit-zero
40+
41+
mypy:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Set up Python 3.12
46+
uses: actions/setup-python@v3
47+
with:
48+
python-version: "3.12"
49+
cache: 'pip' # Will cache miss in parallel first time, but then we should save a lot of time on builds
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install $TEST_DEPS
54+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3755
- name: Lint with mypy
3856
run: |
3957
mypy main.py
40-
#- name: Lint with flake8
41-
# run: |
42-
# # stop the build if there are Python syntax errors or undefined names
43-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
44-
# # can also be more harsh :D
45-
# # flake8 . --count --ignore=W503,W504 --show-source --statistics
46-
# # exit-zero treats all errors as warnings.
47-
# flake8 . --count --exit-zero --max-complexity=10 --statistics
48-
- name: Test with pytest
58+
59+
pytest:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Set up Python 3.12
64+
uses: actions/setup-python@v3
65+
with:
66+
python-version: "3.12"
67+
cache: 'pip' # Will cache miss in parallel first time, but then we should save a lot of time on builds
68+
- name: Install dependencies
69+
run: |
70+
python -m pip install --upgrade pip
71+
pip install $TEST_DEPS
72+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
73+
- name: Lint with pytest
4974
run: |
50-
pytest
75+
pytest main.py

0 commit comments

Comments
 (0)