]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-103180: Set a timeout for every job in GitHub Actions (#130375)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Fri, 21 Feb 2025 15:11:26 +0000 (15:11 +0000)
committerGitHub <noreply@github.com>
Fri, 21 Feb 2025 15:11:26 +0000 (17:11 +0200)
.github/workflows/add-issue-header.yml
.github/workflows/build.yml
.github/workflows/documentation-links.yml
.github/workflows/jit.yml
.github/workflows/mypy.yml
.github/workflows/reusable-docs.yml
.github/workflows/reusable-macos.yml
.github/workflows/reusable-tsan.yml
.github/workflows/reusable-ubuntu.yml
.github/workflows/reusable-wasi.yml
.github/workflows/stale.yml

index 570b8779994a0f9eb24d380213ea7e7721e5cf30..3cbc23af578d106c637264b43fa9bbbe02b8c4cd 100644 (file)
@@ -18,6 +18,7 @@ jobs:
     runs-on: ubuntu-latest
     permissions:
       issues: write
+    timeout-minutes: 5
     steps:
       - uses: actions/github-script@v7
         with:
index e94c483c9ae9dcad512929178cffc4556fff5404..bbb36b17127fa85e35ede19cdab23a810fe0177c 100644 (file)
@@ -43,7 +43,7 @@ jobs:
     if: fromJSON(needs.build-context.outputs.run-docs)
     uses: ./.github/workflows/reusable-docs.yml
 
-  check_autoconf_regen:
+  check-autoconf-regen:
     name: 'Check if Autoconf files are up to date'
     # Don't use ubuntu-latest but a specific version to make the job
     # reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -86,7 +86,7 @@ jobs:
             exit 1
           fi
 
-  check_generated_files:
+  check-generated-files:
     name: 'Check if generated files are up to date'
     # Don't use ubuntu-latest but a specific version to make the job
     # reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -147,7 +147,7 @@ jobs:
         if: github.event_name == 'pull_request'  # $GITHUB_EVENT_NAME
         run: make check-c-globals
 
-  build_windows:
+  build-windows:
     name: >-
       Windows
       ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -179,7 +179,7 @@ jobs:
       arch: ${{ matrix.arch }}
       free-threading: ${{ matrix.free-threading }}
 
-  build_windows_msi:
+  build-windows-msi:
     name: >-  # ${{ '' } is a hack to nest jobs under the same sidebar category
       Windows MSI${{ '' }}
     needs: build-context
@@ -194,7 +194,7 @@ jobs:
     with:
       arch: ${{ matrix.arch }}
 
-  build_macos:
+  build-macos:
     name: >-
       macOS
       ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -228,7 +228,7 @@ jobs:
       free-threading: ${{ matrix.free-threading }}
       os: ${{ matrix.os }}
 
-  build_ubuntu:
+  build-ubuntu:
     name: >-
       Ubuntu
       ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -260,7 +260,7 @@ jobs:
       free-threading: ${{ matrix.free-threading }}
       os: ${{ matrix.os }}
 
-  build_ubuntu_ssltests:
+  build-ubuntu-ssltests:
     name: 'Ubuntu SSL tests with OpenSSL'
     runs-on: ${{ matrix.os }}
     timeout-minutes: 60
@@ -322,7 +322,7 @@ jobs:
     - name: SSL tests
       run: ./python Lib/test/ssltests.py
 
-  build_wasi:
+  build-wasi:
     name: 'WASI'
     needs: build-context
     if: needs.build-context.outputs.run-tests == 'true'
@@ -330,7 +330,7 @@ jobs:
     with:
       config_hash: ${{ needs.build-context.outputs.config-hash }}
 
-  test_hypothesis:
+  test-hypothesis:
     name: "Hypothesis tests on Ubuntu"
     runs-on: ubuntu-24.04
     timeout-minutes: 60
@@ -445,8 +445,7 @@ jobs:
         name: hypothesis-example-db
         path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/examples/
 
-
-  build_asan:
+  build-asan:
     name: 'Address sanitizer'
     runs-on: ${{ matrix.os }}
     timeout-minutes: 60
@@ -509,7 +508,7 @@ jobs:
     - name: Tests
       run: xvfb-run make ci
 
-  build_tsan:
+  build-tsan:
     name: >-
       Thread sanitizer
       ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -528,6 +527,7 @@ jobs:
   cross-build-linux:
     name: Cross build Linux
     runs-on: ubuntu-latest
+    timeout-minutes: 60
     needs: build-context
     if: needs.build-context.outputs.run-tests == 'true'
     steps:
@@ -592,8 +592,8 @@ jobs:
           output-sarif: true
           sanitizer: ${{ matrix.sanitizer }}
       - name: Upload crash
-        uses: actions/upload-artifact@v4
         if: failure() && steps.build.outcome == 'success'
+        uses: actions/upload-artifact@v4
         with:
           name: ${{ matrix.sanitizer }}-artifacts
           path: ./out/artifacts
@@ -606,36 +606,35 @@ jobs:
 
   all-required-green:  # This job does nothing and is only used for the branch protection
     name: All required checks pass
-    if: always()
-
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
     needs:
     - build-context  # Transitive dependency, needed to access `run-tests` value
     - check-docs
-    - check_autoconf_regen
-    - check_generated_files
-    - build_macos
-    - build_ubuntu
-    - build_ubuntu_ssltests
-    - build_wasi
-    - build_windows
-    - build_windows_msi
+    - check-autoconf-regen
+    - check-generated-files
+    - build-windows
+    - build-windows-msi
+    - build-macos
+    - build-ubuntu
+    - build-ubuntu-ssltests
+    - build-wasi
+    - test-hypothesis
+    - build-asan
+    - build-tsan
     - cross-build-linux
-    - test_hypothesis
-    - build_asan
-    - build_tsan
     - cifuzz
-
-    runs-on: ubuntu-latest
+    if: always()
 
     steps:
     - name: Check whether the needed jobs succeeded or failed
       uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
       with:
         allowed-failures: >-
-          build_ubuntu_ssltests,
-          build_windows_msi,
+          build-windows-msi,
+          build-ubuntu-ssltests,
+          test-hypothesis,
           cifuzz,
-          test_hypothesis,
         allowed-skips: >-
           ${{
             !fromJSON(needs.build-context.outputs.run-docs)
@@ -647,15 +646,15 @@ jobs:
           ${{
             needs.build-context.outputs.run-tests != 'true'
             && '
-            check_autoconf_regen,
-            check_generated_files,
-            build_macos,
-            build_ubuntu,
-            build_ubuntu_ssltests,
-            build_wasi,
-            build_asan,
-            build_tsan,
-            test_hypothesis,
+            check-autoconf-regen,
+            check-generated-files,
+            build-macos,
+            build-ubuntu,
+            build-ubuntu-ssltests,
+            build-wasi,
+            test-hypothesis,
+            build-asan,
+            build-tsan,
             cross-build-linux,
             '
             || ''
@@ -663,7 +662,7 @@ jobs:
           ${{
             !fromJSON(needs.build-context.outputs.run-windows-tests)
             && '
-            build_windows,
+            build-windows,
             '
             || ''
           }}
index fdb4b9aa29a7c8049019995b166dd4c16577aeb6..a09a30587b35ebbb7826e375b844273785f896d1 100644 (file)
@@ -19,6 +19,7 @@ jobs:
     runs-on: ubuntu-latest
     permissions:
       pull-requests: write
+    timeout-minutes: 5
 
     steps:
       - uses: readthedocs/actions/preview@v1
index 806a8524112d7652953db161ecae51eded1cfe1e..47fdf5393c816a737fee0a3c1a06fcc3f472dcb9 100644 (file)
@@ -137,6 +137,7 @@ jobs:
     name: Free-Threaded (Debug)
     needs: interpreter
     runs-on: ubuntu-24.04
+    timeout-minutes: 90
     strategy:
       matrix:
         llvm:
index 5dfa8d7bcafd78304fa61820831aa756b6a70b15..6d1c6b5b5e6347f089621555b0c0909687deb7dc 100644 (file)
@@ -33,6 +33,9 @@ concurrency:
 
 jobs:
   mypy:
+    name: Run mypy on ${{ matrix.target }}
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
     strategy:
       fail-fast: false
       matrix:
@@ -46,9 +49,6 @@ jobs:
           "Tools/peg_generator",
           "Tools/wasm",
         ]
-    name: Run mypy on ${{ matrix.target }}
-    runs-on: ubuntu-latest
-    timeout-minutes: 10
     steps:
       - uses: actions/checkout@v4
         with:
index 6738acc98c65656f903f3b103be0a71d1df7129b..79c28223ac3706ccfa14276c46293a9f1c1e4831 100644 (file)
@@ -15,7 +15,7 @@ env:
   FORCE_COLOR: 1
 
 jobs:
-  build_doc:
+  build-doc:
     name: 'Docs'
     runs-on: ubuntu-latest
     timeout-minutes: 60
index 43ce0f957d2d4984e91decc082a844445d346d08..de0c40221364ad9b0ad3a44a52611aec607db096 100644 (file)
@@ -19,8 +19,9 @@ env:
   FORCE_COLOR: 1
 
 jobs:
-  build_macos:
+  build-macos:
     name: build and test (${{ inputs.os }})
+    runs-on: ${{ inputs.os }}
     timeout-minutes: 60
     env:
       HOMEBREW_NO_ANALYTICS: 1
@@ -29,7 +30,6 @@ jobs:
       HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
       PYTHONSTRICTEXTENSIONBUILD: 1
       TERM: linux
-    runs-on: ${{ inputs.os }}
     steps:
     - uses: actions/checkout@v4
       with:
index 5c815f72f0ada569741bc1e8b94e635ed65d7ba1..6a58e5305f8e09bd49bf2407634fd3ac42aa52ca 100644 (file)
@@ -16,7 +16,7 @@ env:
   FORCE_COLOR: 1
 
 jobs:
-  build_tsan_reusable:
+  build-tsan-reusable:
     name: 'Thread sanitizer'
     runs-on: ubuntu-24.04
     timeout-minutes: 60
index 9b366d4dfc212deb90863ca38fd4819c01e2a88d..76b19fd5d1a72e2a3d07959cdbb9e6a323968307 100644 (file)
@@ -25,10 +25,10 @@ env:
   FORCE_COLOR: 1
 
 jobs:
-  build_ubuntu_reusable:
+  build-ubuntu-reusable:
     name: build and test (${{ inputs.os }})
-    timeout-minutes: 60
     runs-on: ${{ inputs.os }}
+    timeout-minutes: 60
     env:
       OPENSSL_VER: 3.0.15
       PYTHONSTRICTEXTENSIONBUILD: 1
index 36a0e4ef6732603c3f76276eb4990692e3c8f044..6beb91e66d402733adbdd0a5e741cc91cf6fe62f 100644 (file)
@@ -11,10 +11,10 @@ env:
   FORCE_COLOR: 1
 
 jobs:
-  build_wasi_reusable:
+  build-wasi-reusable:
     name: 'build and test'
-    timeout-minutes: 60
     runs-on: ubuntu-24.04
+    timeout-minutes: 60
     env:
       WASMTIME_VERSION: 22.0.0
       WASI_SDK_VERSION: 24
index 7578189f5d4d677ea804ca08045771e35ec12cc6..febb2dd823a8fe2e7d1a9c01df461661a37da127 100644 (file)
@@ -7,7 +7,6 @@ on:
 jobs:
   stale:
     if: github.repository_owner == 'python'
-
     runs-on: ubuntu-latest
     permissions:
       pull-requests: write