Skip to content

Commit a225cbb

Browse files
committed
ci: Add job timeout and pytest timeout to prevent hanging
1 parent c6e213e commit a225cbb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
py36:
1212
name: Test on Python 3.6
1313
runs-on: ubuntu-22.04
14+
timeout-minutes: 15
1415
container:
1516
image: python:3.6-slim
1617
steps:
@@ -22,12 +23,13 @@ jobs:
2223
pip install -e .
2324
flake8 scripts/ src/recheck/ --count --select=E9,F63,F7,F82,F821 --show-source --statistics
2425
python scripts/check_py36_compat.py src/recheck/*.py
25-
pytest -v -n auto tests/
26+
pytest -v -n auto --timeout=60 tests/
2627
2728
# Test on Python 3.10 (middle) and 3.13 (latest)
2829
modern:
2930
name: Test on Python ${{ matrix.python-version }}
3031
runs-on: ubuntu-22.04
32+
timeout-minutes: 15
3133
strategy:
3234
matrix:
3335
python-version: ['3.10', '3.13']
@@ -47,4 +49,4 @@ jobs:
4749
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4850
- name: Test with pytest
4951
run: |
50-
pytest -v -n auto tests/
52+
pytest -v -n auto --timeout=60 tests/

0 commit comments

Comments
 (0)