Skip to content

Commit

Permalink
Add timeout for actions/cache restoring (#45198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jan 23, 2023
1 parent e6ff749 commit 775254a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT

- uses: actions/cache@v3
timeout-minutes: 2
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
Expand Down Expand Up @@ -101,6 +102,7 @@ jobs:
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
timeout-minutes: 2
id: cache-build
with:
path: ./*
Expand All @@ -119,6 +121,7 @@ jobs:
- run: npm i -g pnpm@${PNPM_VERSION}

- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
with:
path: ./*
Expand All @@ -131,6 +134,7 @@ jobs:
needs: build
steps:
- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
Expand All @@ -152,13 +156,15 @@ jobs:

- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
with:
path: ~/.cargo/registry
key: stable-ubuntu-clippy-cargo-registry

- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
with:
path: ~/.cargo/git
Expand Down Expand Up @@ -197,6 +203,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -233,6 +240,7 @@ jobs:
check-latest: true

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -272,6 +280,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -332,6 +341,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -391,6 +401,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -441,6 +452,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -486,6 +498,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{ needs.build.outputs.docsChange == 'nope' }}
id: restore-build
with:
Expand Down Expand Up @@ -561,6 +574,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -616,6 +630,7 @@ jobs:
check-latest: true

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -663,6 +678,7 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
steps:
- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -691,6 +707,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand All @@ -715,6 +732,7 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
steps:
- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -754,6 +772,7 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
with:
path: ./*
Expand Down Expand Up @@ -784,6 +803,7 @@ jobs:
VERCEL_TEST_TEAM: vtest314-next-e2e-tests
steps:
- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
with:
path: ./*
Expand Down Expand Up @@ -823,6 +843,7 @@ jobs:
check-latest: true

- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
with:
path: ./*
Expand Down Expand Up @@ -857,13 +878,15 @@ jobs:

- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/registry
key: stable-ubuntu-latest-cargo-registry

- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/git
Expand All @@ -876,6 +899,7 @@ jobs:
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: .turbo
Expand All @@ -895,6 +919,7 @@ jobs:
# So we get latest cache
- name: Cache built files
uses: actions/cache@v3
timeout-minutes: 2
with:
path: ./packages/next-swc/target
key: next-swc-cargo-cache-dev-ubuntu-latest-${{ hashFiles('**/Cargo.lock') }}
Expand Down Expand Up @@ -962,6 +987,7 @@ jobs:

steps:
- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -1146,6 +1172,7 @@ jobs:
# So we get latest cache
- name: Cache built files
uses: actions/cache@v3
timeout-minutes: 2
with:
path: ./packages/next-swc/target
key: next-swc-cargo-cache-${{ matrix.settings.target }}--${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -1170,12 +1197,14 @@ jobs:

- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 2
with:
path: ~/.cargo/registry
key: ${{ matrix.settings.target }}-cargo-registry

- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 2
with:
path: ~/.cargo/git
key: ${{ matrix.settings.target }}-cargo-index
Expand Down Expand Up @@ -1354,6 +1383,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
Expand Down Expand Up @@ -1381,6 +1411,7 @@ jobs:
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
timeout-minutes: 2
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
path: .turbo
Expand Down Expand Up @@ -1440,6 +1471,7 @@ jobs:
check-latest: true

- uses: actions/cache@v3
timeout-minutes: 2
id: restore-build
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ jobs:
id: docs-change

- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/registry
key: stable-ubuntu-latest-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/git
Expand All @@ -48,6 +50,7 @@ jobs:
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
timeout-minutes: 2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: .turbo
Expand All @@ -62,6 +65,7 @@ jobs:
# So we get latest cache
- name: Cache built files
uses: actions/cache@v3
timeout-minutes: 2
with:
path: ./packages/next-target
key: next-swc-cargo-cache-ubuntu-latest--${{ hashFiles('**/Cargo.lock') }}
Expand Down

0 comments on commit 775254a

Please sign in to comment.