Skip to content

Commit

Permalink
Add timeouts to CI jobs (#3586)
Browse files Browse the repository at this point in the history
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._
  • Loading branch information
jdisanti authored Apr 15, 2024
1 parent b52ba10 commit 1009efe
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
acquire-base-image:
runs-on: smithy_ubuntu-latest_8-core
name: Acquire Base Image
timeout-minutes: 60
outputs:
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
permissions:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-merge-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
save-docker-login-token:
name: Save a docker login token
timeout-minutes: 10
outputs:
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
permissions:
Expand Down Expand Up @@ -51,6 +52,7 @@ jobs:
name: Acquire Base Image
needs: save-docker-login-token
runs-on: ubuntu-latest
timeout-minutes: 60
env:
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-pr-forks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
name: Acquire Base Image
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
save-docker-login-token:
name: Save a docker login token
timeout-minutes: 10
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
outputs:
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
Expand Down Expand Up @@ -50,6 +51,7 @@ jobs:
# it uploads the image as a build artifact for other jobs to download and use.
acquire-base-image:
name: Acquire Base Image
timeout-minutes: 60
needs: save-docker-login-token
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
runs-on: smithy_ubuntu-latest_8-core
Expand Down Expand Up @@ -113,6 +115,7 @@ jobs:
semver-checks:
name: check the semver status of this PR
runs-on: smithy_ubuntu-latest_8-core
timeout-minutes: 20
needs:
- save-docker-login-token
- acquire-base-image
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
verify-tls-config:
name: Verify TLS configuration
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Install packages
shell: bash
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
# and also runs some checks/lints so that those are run sooner rather than later.
generate:
name: Generate
timeout-minutes: 25
runs-on: smithy_ubuntu-latest_8-core
# To avoid repeating setup boilerplate, we have the actual commands
# in a matrix strategy. These commands get run in the steps after all the setup.
Expand Down Expand Up @@ -84,6 +85,7 @@ jobs:
test-codegen:
name: Test Codegen
runs-on: ${{ matrix.test.runner }}
timeout-minutes: 30
# To avoid repeating setup boilerplate, we have the actual test commands
# in a matrix strategy. These commands get run in the steps after all the setup.
strategy:
Expand Down Expand Up @@ -140,6 +142,7 @@ jobs:
check-semver-hazards:
name: Check for semver hazards
runs-on: smithy_ubuntu-latest_8-core
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -162,6 +165,7 @@ jobs:
name: Test the SDK
needs: generate
runs-on: ${{ matrix.test.runner }}
timeout-minutes: 20
# To avoid repeating setup boilerplate, we have the actual test commands
# in a matrix strategy. These commands get run in the steps after all the setup.
strategy:
Expand Down Expand Up @@ -193,11 +197,10 @@ jobs:
with:
action: ${{ matrix.test.action }}



test-rust-windows:
name: Rust Tests on Windows
runs-on: windows-latest
timeout-minutes: 20
env:
# Disable incremental compilation to reduce disk space use
CARGO_INCREMENTAL: 0
Expand Down Expand Up @@ -232,6 +235,7 @@ jobs:
test-exotic-platform-support:
name: Exotic platform support
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -335,6 +339,7 @@ jobs:
if: ${{ inputs.run_canary }}
needs: generate
runs-on: smithy_ubuntu-latest_8-core
timeout-minutes: 20
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -373,6 +378,7 @@ jobs:
if: ${{ inputs.run_sdk_examples }}
needs: generate
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 1009efe

Please sign in to comment.