Skip to content

Add cache for BSR modules - #308

Merged
emcfarlane merged 3 commits into
mainfrom
ed/cache2
Nov 3, 2026
Merged

emcfarlane merged 3 commits into
mainfrom
ed/cache2

Conversation

@emcfarlane

Copy link
Copy Markdown
Collaborator

Provide a cache setup for BSR modules. This helps speed up downloads of registry dependencies. Defaults to false, set cache: true to enable.

@emcfarlane
emcfarlane requested a review from pkwarren November 2, 2026 21:36
@github-actions

This comment has been minimized.

Comment thread action.yml
public_github_token:
description: |-
GitHub token for github.com. Must be set when running on a private GitHub Enterprise instance to authenticate requests, otherwise ignored. Used to resolve buf versions and download buf binaries from github.com. The token only needs read access to public repositories.
cache:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added cache-hit to output.

Comment thread src/post.ts Resolved
Comment thread .github/workflows/ci.yaml Outdated
archive: false
pr_comment: false
- name: Check the module cache was populated
run: test -d ~/.cache/buf/v3/modules

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't testing the action's caching - buf dep update will update the lock file and populate the cache. I set BUF_CACHE_DIR and ran the commands above and it populated these dirs:

> tree -d -L 6 cache/
cache/
└── v3
    ├── commitlocks
    ├── commits
    ├── modulelocks
    │   └── b5
    │       └── buf.build
    │           └── googleapis
    │               └── googleapis
    ├── modules
    │   └── b5
    │       └── buf.build
    │           └── googleapis
    │               └── googleapis
    ├── plugins
    ├── policies
    └── wellknowntypes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expanded.

@emcfarlane
emcfarlane marked this pull request as ready for review November 3, 2026 20:37
@emcfarlane
emcfarlane merged commit 786ca81 into main Nov 3, 2026
77 of 78 checks passed
@emcfarlane
emcfarlane deleted the ed/cache2 branch November 3, 2026 20:39
@emcfarlane emcfarlane mentioned this pull request Nov 3, 2026
emcfarlane added a commit that referenced this pull request Nov 3, 2026
Below is propose release notes:

## What's Changed
* Add cache for BSR modules and plugins by @emcfarlane in
#308

**Full Changelog**:
v1.6.0...v1.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants