Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪲 Prevent infinite growth of turbo cache #1051

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/workflows/actions/setup-build-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,7 @@ runs:
# This step will speed up workflow runs that don't touch the whole codebase
# (or the ones that don't touch the codebase at all)
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ github.sha }}
# The hierarchy of restoring the cache goes as follows:
#
# - First we try to match an existing cache from the same branch
# - Then we try to match a cache from the target branch of this PR (if this is not a PR, this cache will never exist)
# - Then we try to match a cache from the default branch
# - Then we try to match any cache
restore-keys: |
${{ runner.os }}-turbo-${{ github.ref_name }}-
${{ runner.os }}-turbo-${{ github.base_ref }}-
${{ runner.os }}-turbo-${{ github.event.repository.default_branch }}-
${{ runner.os }}-turbo-
uses: rharkor/caching-for-turbo@439abec0d28d21b192fa8817b744ffdf1ee5ac0d

# Cache hardhat compilers
#
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ jobs:
- name: Setup environment
uses: ./.github/workflows/actions/setup-environment

- name: Setup build cache
uses: ./.github/workflows/actions/setup-build-cache

# There is a small bug in docker compose that will cause 401 if we don't pull the base image manually
#
# See more here https://github.com/docker/compose-cli/issues/1545
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ services:
pnpm release:version
pnpm release:publish
volumes:
# Build cache
- ./node_modules/.cache/turbo:/app/node_modules/.cache/turbo
# We'll need to provide the changeset files for this step
- ./.changeset:/app/.changeset

Expand Down