Skip to content

Commit 9dd2cb7

Browse files
authored
[3.13] GH-103180: Set a timeout for every job in GitHub Actions (GH-130375) (#130431)
(cherry picked from commit d0a1e5c)
1 parent bb4cd89 commit 9dd2cb7

11 files changed

+54
-54
lines changed

.github/workflows/add-issue-header.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
permissions:
2020
issues: write
21+
timeout-minutes: 5
2122
steps:
2223
- uses: actions/github-script@v7
2324
with:

.github/workflows/build.yml

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
if: fromJSON(needs.build-context.outputs.run-docs)
4444
uses: ./.github/workflows/reusable-docs.yml
4545

46-
check_abi:
46+
check-abi:
4747
name: 'Check if the ABI has changed'
4848
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
4949
needs: build-context
@@ -88,7 +88,7 @@ jobs:
8888
name: abi-data
8989
path: ./Doc/data/*.abi
9090

91-
check_autoconf_regen:
91+
check-autoconf-regen:
9292
name: 'Check if Autoconf files are up to date'
9393
# Don't use ubuntu-latest but a specific version to make the job
9494
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -131,7 +131,7 @@ jobs:
131131
exit 1
132132
fi
133133
134-
check_generated_files:
134+
check-generated-files:
135135
name: 'Check if generated files are up to date'
136136
# Don't use ubuntu-latest but a specific version to make the job
137137
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -192,7 +192,7 @@ jobs:
192192
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
193193
run: make check-c-globals
194194

195-
build_windows:
195+
build-windows:
196196
name: >-
197197
Windows
198198
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -224,7 +224,7 @@ jobs:
224224
arch: ${{ matrix.arch }}
225225
free-threading: ${{ matrix.free-threading }}
226226

227-
build_windows_msi:
227+
build-windows-msi:
228228
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
229229
Windows MSI${{ '' }}
230230
needs: build-context
@@ -239,7 +239,7 @@ jobs:
239239
with:
240240
arch: ${{ matrix.arch }}
241241

242-
build_macos:
242+
build-macos:
243243
name: >-
244244
macOS
245245
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -273,7 +273,7 @@ jobs:
273273
free-threading: ${{ matrix.free-threading }}
274274
os: ${{ matrix.os }}
275275

276-
build_ubuntu:
276+
build-ubuntu:
277277
name: >-
278278
Ubuntu
279279
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -289,7 +289,7 @@ jobs:
289289
config_hash: ${{ needs.build-context.outputs.config-hash }}
290290
free-threading: ${{ matrix.free-threading }}
291291

292-
build_ubuntu_ssltests:
292+
build-ubuntu-ssltests:
293293
name: 'Ubuntu SSL tests with OpenSSL'
294294
runs-on: ${{ matrix.os }}
295295
timeout-minutes: 60
@@ -350,15 +350,15 @@ jobs:
350350
- name: SSL tests
351351
run: ./python Lib/test/ssltests.py
352352

353-
build_wasi:
353+
build-wasi:
354354
name: 'WASI'
355355
needs: build-context
356356
if: needs.build-context.outputs.run-tests == 'true'
357357
uses: ./.github/workflows/reusable-wasi.yml
358358
with:
359359
config_hash: ${{ needs.build-context.outputs.config-hash }}
360360

361-
test_hypothesis:
361+
test-hypothesis:
362362
name: "Hypothesis tests on Ubuntu"
363363
runs-on: ubuntu-24.04
364364
timeout-minutes: 60
@@ -472,8 +472,7 @@ jobs:
472472
name: hypothesis-example-db
473473
path: .hypothesis/examples/
474474

475-
476-
build_asan:
475+
build-asan:
477476
name: 'Address sanitizer'
478477
runs-on: ${{ matrix.os }}
479478
timeout-minutes: 60
@@ -536,7 +535,7 @@ jobs:
536535
- name: Tests
537536
run: xvfb-run make test
538537

539-
build_tsan:
538+
build-tsan:
540539
name: >-
541540
Thread sanitizer
542541
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -580,8 +579,8 @@ jobs:
580579
output-sarif: true
581580
sanitizer: ${{ matrix.sanitizer }}
582581
- name: Upload crash
583-
uses: actions/upload-artifact@v4
584582
if: failure() && steps.build.outcome == 'success'
583+
uses: actions/upload-artifact@v4
585584
with:
586585
name: ${{ matrix.sanitizer }}-artifacts
587586
path: ./out/artifacts
@@ -594,35 +593,34 @@ jobs:
594593

595594
all-required-green: # This job does nothing and is only used for the branch protection
596595
name: All required checks pass
597-
if: always()
598-
596+
runs-on: ubuntu-latest
597+
timeout-minutes: 5
599598
needs:
600599
- build-context # Transitive dependency, needed to access `run-tests` value
601600
- check-docs
602-
- check_autoconf_regen
603-
- check_generated_files
604-
- build_macos
605-
- build_ubuntu
606-
- build_ubuntu_ssltests
607-
- build_wasi
608-
- build_windows
609-
- build_windows_msi
610-
- test_hypothesis
611-
- build_asan
612-
- build_tsan
601+
- check-autoconf-regen
602+
- check-generated-files
603+
- build-windows
604+
- build-windows-msi
605+
- build-macos
606+
- build-ubuntu
607+
- build-ubuntu-ssltests
608+
- build-wasi
609+
- test-hypothesis
610+
- build-asan
611+
- build-tsan
613612
- cifuzz
614-
615-
runs-on: ubuntu-latest
613+
if: always()
616614

617615
steps:
618616
- name: Check whether the needed jobs succeeded or failed
619617
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
620618
with:
621619
allowed-failures: >-
622-
build_ubuntu_ssltests,
623-
build_windows_msi,
620+
build-windows-msi,
621+
build-ubuntu-ssltests,
622+
test-hypothesis,
624623
cifuzz,
625-
test_hypothesis,
626624
allowed-skips: >-
627625
${{
628626
!fromJSON(needs.build-context.outputs.run-docs)
@@ -634,22 +632,22 @@ jobs:
634632
${{
635633
needs.build-context.outputs.run-tests != 'true'
636634
&& '
637-
check_autoconf_regen,
638-
check_generated_files,
639-
build_macos,
640-
build_ubuntu,
641-
build_ubuntu_ssltests,
642-
build_wasi,
643-
build_asan,
644-
build_tsan,
645-
test_hypothesis,
635+
check-autoconf-regen,
636+
check-generated-files,
637+
build-macos,
638+
build-ubuntu,
639+
build-ubuntu-ssltests,
640+
build-wasi,
641+
test-hypothesis,
642+
build-asan,
643+
build-tsan,
646644
'
647645
|| ''
648646
}}
649647
${{
650648
!fromJSON(needs.build-context.outputs.run-windows-tests)
651649
&& '
652-
build_windows,
650+
build-windows,
653651
'
654652
|| ''
655653
}}

.github/workflows/documentation-links.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
permissions:
2121
pull-requests: write
22+
timeout-minutes: 5
2223

2324
steps:
2425
- uses: readthedocs/actions/preview@v1

.github/workflows/jit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ jobs:
172172
name: Free-Threaded (Debug)
173173
needs: interpreter
174174
runs-on: ubuntu-latest
175+
timeout-minutes: 90
175176
steps:
176177
- uses: actions/checkout@v4
177178
with:

.github/workflows/mypy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ concurrency:
3333

3434
jobs:
3535
mypy:
36+
name: Run mypy on ${{ matrix.target }}
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 10
3639
strategy:
3740
fail-fast: false
3841
matrix:
@@ -46,9 +49,6 @@ jobs:
4649
"Tools/peg_generator",
4750
"Tools/wasm",
4851
]
49-
name: Run mypy on ${{ matrix.target }}
50-
runs-on: ubuntu-latest
51-
timeout-minutes: 10
5252
steps:
5353
- uses: actions/checkout@v4
5454
with:

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
FORCE_COLOR: 1
1616

1717
jobs:
18-
build_doc:
18+
build-doc:
1919
name: 'Docs'
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 60

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ env:
1919
FORCE_COLOR: 1
2020

2121
jobs:
22-
build_macos:
22+
build-macos:
2323
name: build and test (${{ inputs.os }})
24+
runs-on: ${{ inputs.os }}
2425
timeout-minutes: 60
2526
env:
2627
HOMEBREW_NO_ANALYTICS: 1
@@ -29,7 +30,6 @@ jobs:
2930
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
3031
PYTHONSTRICTEXTENSIONBUILD: 1
3132
TERM: linux
32-
runs-on: ${{ inputs.os }}
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:

.github/workflows/reusable-tsan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
FORCE_COLOR: 1
1717

1818
jobs:
19-
build_tsan_reusable:
19+
build-tsan-reusable:
2020
name: 'Thread sanitizer'
2121
runs-on: ubuntu-24.04
2222
timeout-minutes: 60

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ env:
1616
FORCE_COLOR: 1
1717

1818
jobs:
19-
build_ubuntu_reusable:
19+
build-ubuntu-reusable:
2020
name: 'build and test'
21-
timeout-minutes: 60
2221
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 60
2323
strategy:
2424
fail-fast: false
2525
matrix:

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ env:
1111
FORCE_COLOR: 1
1212

1313
jobs:
14-
build_wasi_reusable:
14+
build-wasi-reusable:
1515
name: 'build and test'
16-
timeout-minutes: 60
1716
runs-on: ubuntu-24.04
17+
timeout-minutes: 60
1818
env:
1919
WASMTIME_VERSION: 22.0.0
2020
WASI_SDK_VERSION: 24

.github/workflows/stale.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
jobs:
88
stale:
99
if: github.repository_owner == 'python'
10-
1110
runs-on: ubuntu-latest
1211
permissions:
1312
pull-requests: write

0 commit comments

Comments
 (0)