Skip to content

Commit

Permalink
chore(repo): Limit job/step execution time using timeout-minutes (#2032)
Browse files Browse the repository at this point in the history
* chore(repo): Limit job/step execution time using timeout-minutes

* Create selfish-eggs-sort.md
  • Loading branch information
nikosdouvlis authored Nov 3, 2023
1 parent 69711e1 commit 88faa3b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changeset/selfish-eggs-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions .github/workflows/base-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:
build:
# if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/base-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
jobs:
run:
continue-on-error: true
timeout-minutes: 60
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_LONG }}
concurrency:
group: integration-${{ github.ref }}-${{ inputs.script }}
cancel-in-progress: true
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ jobs:
formatting-linting:
name: Formatting, linting & changeset checks
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}

steps:
- name: Checkout Repo
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false

- name: Setup
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
id: config
uses: ./.github/actions/init
with:
Expand All @@ -44,25 +47,31 @@ jobs:
echo "FORCE_COLOR: $FORCE_COLOR"
- name: Require Changeset
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi

- name: Check Formatting
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
run: npm run format:check

- name: Lint packages using publint
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
run: npm run lint:publint -- $TURBO_ARGS

- name: Lint types using attw
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
run: npm run lint:attw -- $TURBO_ARGS
continue-on-error: true # TODO: Remove this when all related errors are fixed

- name: Run lint
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
run: npm run lint -- $TURBO_ARGS -- --quiet

unit-tests:
name: Unit Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}

strategy:
matrix:
Expand Down Expand Up @@ -93,6 +102,7 @@ jobs:
name: Integration Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}

strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

jobs:
triage:
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
permissions:
contents: read
pull-requests: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:

jobs:
action:
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }}
runs-on: ${{ vars.RUNNER_NORMAL }}
steps:
- uses: actions/stale@v8
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
snapshot-release:
if: ${{ startsWith(github.event.comment.body, '!snapshot') && github.repository == 'clerk/javascript' && github.event.issue.pull_request }}
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
staging-release:
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
name: Release
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }}
permissions:
contents: write
id-token: write
Expand Down

0 comments on commit 88faa3b

Please sign in to comment.