Skip to content

Add yarn caching to workflows that install yarn dependencies#17680

Merged
CamSoper merged 2 commits intomasterfrom
CamSoper/yarn-cache-workflows
Feb 26, 2026
Merged

Add yarn caching to workflows that install yarn dependencies#17680
CamSoper merged 2 commits intomasterfrom
CamSoper/yarn-cache-workflows

Conversation

@CamSoper
Copy link
Copy Markdown
Contributor

@CamSoper CamSoper commented Feb 25, 2026

Adds cache: 'yarn' to actions/setup-node in the 10 workflows that actually run yarn install or make ensure, with cache-dependency-path pointing at all four yarn.lock files in the repo. On cache hits, yarn runs fully offline, eliminating transient build failures caused by upstream registry errors (HTTP 500, etc.).

Three workflows (bucket-cleanup.yml, bucket-cleanup-testing.yml, pr-closed.yml) install Node but never call yarn, so they are left unchanged.

For three workflows where setup-node appeared before actions/checkout, the checkout step is moved earlier so the lockfiles are present when the cache key is computed.

Mirrors the fix applied in pulumi/registry#9953.

… registry failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 25, 2026

Docs Review

This PR adds yarn caching to all 13 GitHub Actions workflows and reorders checkout steps in 3 workflows where setup-node appeared before actions/checkout. The changes are well-structured and consistent.

Infrastructure changes

The approach is technically sound and mirrors the fix applied in pulumi/registry#9953. A few notes:

esc-cli.yml and pulumi-cli.yml correctly use docs/-prefixed paths (e.g., docs/yarn.lock) since these workflows operate with a docs/ working directory or subdirectory. The additional pulumi/sdk/nodejs/yarn.lock entry in pulumi-cli.yml is appropriate for that workflow's scope.

Checkout step reordering in scheduled-test.yml, scheduled-upgrade-programs.yml, and update-search-index.yml is necessary and correctly done — the lockfiles must exist on disk before setup-node can hash them for cache key generation.

Potential concern: BUILD-AND-DEPLOY.md

Per repository review criteria, changes to .github/workflows/ files should be accompanied by a BUILD-AND-DEPLOY.md update if they affect documented workflow behavior. These changes are an optimization (not a new feature), but if BUILD-AND-DEPLOY.md describes the workflow structure or CI/CD process, a brief note about yarn caching being enabled would be helpful for future maintainers. This is a minor suggestion, not a blocker.

Summary

No issues with correctness, consistency, or approach. The PR is clean and focused. If you'd like an additional review or have follow-up questions, feel free to mention @claude.

@pulumi-bot
Copy link
Copy Markdown
Collaborator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CamSoper CamSoper changed the title Add yarn caching to all GitHub Actions workflows Add yarn caching to workflows that install yarn dependencies Feb 25, 2026
@pulumi-bot
Copy link
Copy Markdown
Collaborator

@pulumi-bot
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Yarn dependency caching to GitHub Actions workflows that install Node/Yarn dependencies, improving reliability by enabling offline installs when the cache is warm and ensuring lockfiles are available when cache keys are computed.

Changes:

  • Added cache: yarn plus cache-dependency-path to actions/setup-node in workflows that run yarn install and/or make ensure.
  • Reordered steps in select workflows to run actions/checkout before actions/setup-node so lockfiles are present for cache key computation.
  • Included all relevant yarn.lock paths per workflow (including nested checkouts like docs/ and pulumi/ where applicable).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/update-search-index.yml Moves checkout before setup-node and enables Yarn caching keyed on lockfiles.
.github/workflows/testing-build-and-deploy.yml Enables Yarn caching keyed on lockfiles for the testing deploy workflow.
.github/workflows/scheduled-upgrade-programs.yml Moves checkout earlier and enables Yarn caching keyed on lockfiles.
.github/workflows/scheduled-test.yml Moves checkout + master fetch earlier and enables Yarn caching keyed on lockfiles.
.github/workflows/pulumi-cli.yml Enables Yarn caching for the docs + pulumi repo multi-checkout workflow (includes both docs/ and pulumi/ lockfiles).
.github/workflows/pull-request.yml Enables Yarn caching keyed on lockfiles for PR builds.
.github/workflows/esc-cli.yml Enables Yarn caching keyed on lockfiles for the docs repo checkout under docs/.
.github/workflows/check-search-urls.yml Enables Yarn caching keyed on lockfiles for the search URL checker workflow.
.github/workflows/check-links.yml Enables Yarn caching keyed on lockfiles for the link checker workflow.
.github/workflows/build-and-deploy.yml Enables Yarn caching keyed on lockfiles for production builds/deploys.

@CamSoper CamSoper merged commit cb97014 into master Feb 26, 2026
19 of 20 checks passed
@CamSoper CamSoper deleted the CamSoper/yarn-cache-workflows branch February 26, 2026 21:00
cnunciato pushed a commit that referenced this pull request Mar 4, 2026
* Add yarn caching to all GitHub Actions workflows to prevent transient registry failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Remove yarn cache config from workflows that don't install yarn deps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

5 participants