Skip to content

Commit 2ad720f

Browse files
authored
Merge pull request #706 from webknjaz/maintenance/ci-timeouts
2 parents 0c37f9d + 768202a commit 2ad720f

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

.github/workflows/build-manylinux-container-images.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on: # yamllint disable-line rule:truthy
2121
jobs:
2222
build:
2323
runs-on: ubuntu-latest
24+
25+
timeout-minutes: 120
26+
2427
strategy:
2528
matrix:
2629
IMAGE:

.github/workflows/ci-cd.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ jobs:
433433
- pre-setup
434434
runs-on: ubuntu-latest
435435

436+
timeout-minutes: 2 # network is slow sometimes
437+
436438
env:
437439
TOXENV: make-changelog
438440

@@ -756,6 +758,9 @@ jobs:
756758
- build-changelog
757759
- pre-setup # transitive, for accessing settings
758760
runs-on: ${{ matrix.runner-vm-os }}
761+
762+
timeout-minutes: 2
763+
759764
strategy:
760765
matrix:
761766
python-version:
@@ -975,6 +980,9 @@ jobs:
975980
registry: registry.access.redhat.com
976981

977982
runs-on: ubuntu-latest
983+
984+
timeout-minutes: 5
985+
978986
container:
979987
# NOTE: GHA has poor support for concat which is why I resorted to
980988
# NOTE: using this ugly ternary syntax
@@ -1302,6 +1310,8 @@ jobs:
13021310
- pre-setup # transitive, for accessing settings
13031311
runs-on: ubuntu-latest
13041312

1313+
timeout-minutes: 1
1314+
13051315
env:
13061316
TOXENV: metadata-validation
13071317

@@ -1386,6 +1396,8 @@ jobs:
13861396

13871397
runs-on: Ubuntu-latest
13881398

1399+
timeout-minutes: 1
1400+
13891401
steps:
13901402
- name: Decide whether the needed jobs succeeded or failed
13911403
uses: re-actors/alls-green@release/v1
@@ -1498,6 +1510,8 @@ jobs:
14981510
&& needs.publish-pypi.result == 'success'
14991511
runs-on: ubuntu-latest
15001512

1513+
timeout-minutes: 1
1514+
15011515
outputs:
15021516
pull_request_url: ${{ steps.pr.outputs.pull_request_url }}
15031517

@@ -1783,6 +1797,8 @@ jobs:
17831797
)
17841798
runs-on: ubuntu-latest
17851799

1800+
timeout-minutes: 5
1801+
17861802
environment:
17871803
name: github-pages
17881804
url: ${{ steps.deployment.outputs.page_url }}/simple/ansible-pylibssh/

.github/workflows/reusable-linters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
name: >-
1414
${{ matrix.toxenv }}/${{ matrix.python-version }}@${{ matrix.os }}
1515
runs-on: ${{ matrix.os }}
16+
17+
timeout-minutes: 2
18+
1619
strategy:
1720
fail-fast: false
1821
matrix:

.github/workflows/reusable-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ jobs:
7171
${{ inputs.dist-type }} dist
7272
runs-on: ${{ inputs.runner-vm-os }}
7373

74+
timeout-minutes: 7
75+
7476
continue-on-error: >-
7577
${{
7678
(

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ repos:
2424
hooks:
2525
- id: remove-tabs
2626

27+
- repo: https://github.com/python-jsonschema/check-jsonschema.git
28+
rev: 0.33.0
29+
hooks:
30+
- id: check-jsonschema
31+
name: Check GitHub Workflows set timeout-minutes
32+
args:
33+
- --builtin-schema
34+
- github-workflows-require-timeout
35+
files: ^\.github/workflows/[^/]+$
36+
types:
37+
- yaml
38+
2739
- repo: https://github.com/pre-commit/pygrep-hooks.git
2840
rev: v1.10.0
2941
hooks:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The CI is now configured to always set job timeout values.
2+
This will ensure that the jobs that get stuck don't consume
3+
all 6 hours just hanging, improving responsiveness and the
4+
overall CI/CD resource usage.
5+
6+
-- by :user:`webknjaz`

0 commit comments

Comments
 (0)