Skip to content

Commit 7a125e8

Browse files
authored
Set job timeouts in Github Actions (#5526)
* Set job timeouts in Github Actions * workers-sdk tests are slow; give 30 mins to be extra safe * Allow bypassing job timeouts
1 parent b1e6458 commit 7a125e8

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

.github/workflows/_bazel.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ on:
5959
type: boolean
6060
required: false
6161
default: false
62+
disable_job_timeouts:
63+
type: boolean
64+
required: false
65+
default: false
6266
secrets:
6367
BAZEL_CACHE_KEY:
6468
required: true
@@ -74,6 +78,8 @@ permissions:
7478
jobs:
7579
bazel:
7680
runs-on: ${{ inputs.image }}
81+
# Cancel all builds taking longer than an hour, except on Windows
82+
timeout-minutes: ${{ (inputs.disable_job_timeouts && 360) || (inputs.os_name == 'windows' && 90) || 60 }}
7783
steps:
7884
- uses: actions/checkout@v4
7985
with:

.github/workflows/_wpt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ permissions:
2323
jobs:
2424
wpt-report:
2525
runs-on: ${{ inputs.image }}
26+
timeout-minutes: 15
2627
steps:
2728
- uses: actions/checkout@v4
2829
- name: Download test logs

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ concurrency:
1616
jobs:
1717
lint:
1818
runs-on: ubuntu-24.04
19+
timeout-minutes: 15
1920
steps:
2021
- uses: actions/checkout@v4
2122
with:

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
arch_name: ${{ matrix.os.arch }}
7777
suffix: ${{ matrix.config.suffix }}
7878
extra_bazel_args: '--config=ci-test --config=ci-${{matrix.os.name}}${{matrix.config.suffix}}'
79+
disable_job_timeouts: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'slow') }}
7980
secrets:
8081
BAZEL_CACHE_KEY: ${{ secrets.BAZEL_CACHE_KEY }}
8182
WORKERS_MIRROR_URL: ${{ secrets.WORKERS_MIRROR_URL }}
@@ -91,6 +92,7 @@ jobs:
9192
extra_bazel_args: '--config=ci-test --config=ci-linux'
9293
upload_test_logs: true
9394
upload_binary: true
95+
disable_job_timeouts: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'slow') }}
9496
secrets:
9597
BAZEL_CACHE_KEY: ${{ secrets.BAZEL_CACHE_KEY }}
9698
WORKERS_MIRROR_URL: ${{ secrets.WORKERS_MIRROR_URL }}
@@ -107,6 +109,7 @@ jobs:
107109

108110
check-snapshot:
109111
runs-on: ubuntu-22.04
112+
timeout-minutes: 15
110113
steps:
111114
- uses: actions/checkout@v4
112115
with:
@@ -169,6 +172,7 @@ jobs:
169172
needs: [test-linux, check-snapshot]
170173
name: Run workers-sdk tests
171174
runs-on: ubuntu-22.04
175+
timeout-minutes: 30
172176
steps:
173177
- name: Checkout workers-sdk
174178
uses: actions/checkout@v4

0 commit comments

Comments
 (0)