From 88faa3bfbc2ce286098e439fdf5c2283a4a529fb Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Fri, 3 Nov 2023 15:22:50 +0200 Subject: [PATCH] chore(repo): Limit job/step execution time using timeout-minutes (#2032) * chore(repo): Limit job/step execution time using timeout-minutes * Create selfish-eggs-sort.md --- .changeset/selfish-eggs-sort.md | 2 ++ .github/workflows/base-build.yml | 1 + .github/workflows/base-e2e.yml | 2 +- .github/workflows/ci.yml | 10 ++++++++++ .github/workflows/labeler.yml | 1 + .github/workflows/lock-threads.yml | 1 + .github/workflows/release-snapshot.yml | 1 + .github/workflows/release-staging.yml | 1 + .github/workflows/release.yml | 1 + 9 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .changeset/selfish-eggs-sort.md diff --git a/.changeset/selfish-eggs-sort.md b/.changeset/selfish-eggs-sort.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/selfish-eggs-sort.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/base-build.yml b/.github/workflows/base-build.yml index 5460dccc5c..d023431b6c 100644 --- a/.github/workflows/base-build.yml +++ b/.github/workflows/base-build.yml @@ -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 diff --git a/.github/workflows/base-e2e.yml b/.github/workflows/base-e2e.yml index b1bd5c5768..126c802f33 100644 --- a/.github/workflows/base-e2e.yml +++ b/.github/workflows/base-e2e.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3cff3b679..a74691bc9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: @@ -93,6 +102,7 @@ jobs: name: Integration Tests needs: formatting-linting runs-on: ${{ vars.RUNNER_LARGE }} + timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL }} strategy: matrix: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 673267813f..5c15aa76b2 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -5,6 +5,7 @@ on: jobs: triage: + timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }} permissions: contents: read pull-requests: write diff --git a/.github/workflows/lock-threads.yml b/.github/workflows/lock-threads.yml index fb5cef1b15..fd4a25b09b 100644 --- a/.github/workflows/lock-threads.yml +++ b/.github/workflows/lock-threads.yml @@ -17,6 +17,7 @@ concurrency: jobs: action: + timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT }} runs-on: ${{ vars.RUNNER_NORMAL }} steps: - uses: actions/stale@v8 diff --git a/.github/workflows/release-snapshot.yml b/.github/workflows/release-snapshot.yml index b107bb8bb2..4dcb44cb4b 100644 --- a/.github/workflows/release-snapshot.yml +++ b/.github/workflows/release-snapshot.yml @@ -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 }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 462a7caf2f..5c0ca80169 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7f0b3d8f5..bcb1199b0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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