Skip to content

Commit 1009efe

Browse files
authored
Add timeouts to CI jobs (#3586)
This PR adds reasonable timeouts to each CI job so that a PR isn't held up for six hours by a hung runner. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent b52ba10 commit 1009efe

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

.github/workflows/ci-main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
acquire-base-image:
2424
runs-on: smithy_ubuntu-latest_8-core
2525
name: Acquire Base Image
26+
timeout-minutes: 60
2627
outputs:
2728
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
2829
permissions:

.github/workflows/ci-merge-queue.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
2323
save-docker-login-token:
2424
name: Save a docker login token
25+
timeout-minutes: 10
2526
outputs:
2627
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
2728
permissions:
@@ -51,6 +52,7 @@ jobs:
5152
name: Acquire Base Image
5253
needs: save-docker-login-token
5354
runs-on: ubuntu-latest
55+
timeout-minutes: 60
5456
env:
5557
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
5658
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}

.github/workflows/ci-pr-forks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
name: Acquire Base Image
2121
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
2222
runs-on: ubuntu-latest
23+
timeout-minutes: 60
2324
steps:
2425
- uses: actions/checkout@v4
2526
with:

.github/workflows/ci-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
2222
save-docker-login-token:
2323
name: Save a docker login token
24+
timeout-minutes: 10
2425
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
2526
outputs:
2627
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
@@ -50,6 +51,7 @@ jobs:
5051
# it uploads the image as a build artifact for other jobs to download and use.
5152
acquire-base-image:
5253
name: Acquire Base Image
54+
timeout-minutes: 60
5355
needs: save-docker-login-token
5456
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
5557
runs-on: smithy_ubuntu-latest_8-core
@@ -113,6 +115,7 @@ jobs:
113115
semver-checks:
114116
name: check the semver status of this PR
115117
runs-on: smithy_ubuntu-latest_8-core
118+
timeout-minutes: 20
116119
needs:
117120
- save-docker-login-token
118121
- acquire-base-image

.github/workflows/ci-tls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
verify-tls-config:
2020
name: Verify TLS configuration
2121
runs-on: ubuntu-latest
22+
timeout-minutes: 20
2223
steps:
2324
- name: Install packages
2425
shell: bash

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
# and also runs some checks/lints so that those are run sooner rather than later.
4949
generate:
5050
name: Generate
51+
timeout-minutes: 25
5152
runs-on: smithy_ubuntu-latest_8-core
5253
# To avoid repeating setup boilerplate, we have the actual commands
5354
# in a matrix strategy. These commands get run in the steps after all the setup.
@@ -84,6 +85,7 @@ jobs:
8485
test-codegen:
8586
name: Test Codegen
8687
runs-on: ${{ matrix.test.runner }}
88+
timeout-minutes: 30
8789
# To avoid repeating setup boilerplate, we have the actual test commands
8890
# in a matrix strategy. These commands get run in the steps after all the setup.
8991
strategy:
@@ -140,6 +142,7 @@ jobs:
140142
check-semver-hazards:
141143
name: Check for semver hazards
142144
runs-on: smithy_ubuntu-latest_8-core
145+
timeout-minutes: 20
143146
steps:
144147
- uses: actions/checkout@v4
145148
with:
@@ -162,6 +165,7 @@ jobs:
162165
name: Test the SDK
163166
needs: generate
164167
runs-on: ${{ matrix.test.runner }}
168+
timeout-minutes: 20
165169
# To avoid repeating setup boilerplate, we have the actual test commands
166170
# in a matrix strategy. These commands get run in the steps after all the setup.
167171
strategy:
@@ -193,11 +197,10 @@ jobs:
193197
with:
194198
action: ${{ matrix.test.action }}
195199

196-
197-
198200
test-rust-windows:
199201
name: Rust Tests on Windows
200202
runs-on: windows-latest
203+
timeout-minutes: 20
201204
env:
202205
# Disable incremental compilation to reduce disk space use
203206
CARGO_INCREMENTAL: 0
@@ -232,6 +235,7 @@ jobs:
232235
test-exotic-platform-support:
233236
name: Exotic platform support
234237
runs-on: ubuntu-latest
238+
timeout-minutes: 10
235239
strategy:
236240
fail-fast: false
237241
matrix:
@@ -335,6 +339,7 @@ jobs:
335339
if: ${{ inputs.run_canary }}
336340
needs: generate
337341
runs-on: smithy_ubuntu-latest_8-core
342+
timeout-minutes: 20
338343
permissions:
339344
id-token: write
340345
contents: read
@@ -373,6 +378,7 @@ jobs:
373378
if: ${{ inputs.run_sdk_examples }}
374379
needs: generate
375380
runs-on: ubuntu-latest
381+
timeout-minutes: 20
376382
steps:
377383
- uses: actions/checkout@v4
378384
with:

0 commit comments

Comments
 (0)