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

test: implement example pnpm workflow caching #1228

Merged

Conversation

MikeMcC399
Copy link
Collaborator

Issue

  • PR test: remove pnpm store caching #1188 removed pnpm caching due to reliability issues.
  • The enhancement request Add dependency caching to pnpm #1044 remains open and at this time there is no native pnpm caching implemented in cypress-io/github-action.
  • Lack of pnpm caching can cause a performance impact on workflows, negatively affecting the usability of cypress-io/github-action.

Background

pnpm Continuous Integration > GitHub Actions documentation recommends installing pnpm with pnpm/action-setup and caching pnpm with GitHub's actions/setup-node.

Change

In workflow:

make the following changes:

  • install pnpm with pnpm/action-setup
  • install Node.js 20 with actions/setup-node and select pnpm. Note that cache-dependency-path: examples/basic-pnpm/pnpm-lock.yaml is necessary, since this is a monorepo and actions/setup-node does not support the use of working-directory at this time.

In the README > pnpm section, add the steps as above and refer to the pnpm Continuous Integration > GitHub Actions documentation.

Verification

Delete Actions caches

Run workflow example-basic-pnpm
Note completion time (4m 5s)

Record cache sizes

Cache Size Usage
node-cache-Windows-pnpm 6 MB pnpm cache
cypress-win32-x64 170 MB Cypress binary
pnpm-win32-x64 773 B not relevant
node-cache-macOS-pnpm 6.1 MB pnpm cache
cypress-darwin-arm64 140 MB Cypress binary
pnpm-darwin-arm64 757 B not relevant
node-cache-Linux-pnpm 6.1 MB pnpm cache
cypress-linux-x64 170 MB Cypress binary
pnpm-linux-x64 783 B not relevant

Run workflow example-basic-pnpm a second time
Note completion time (2m 31s) (faster than first time)

Check caches. There should be no (significant) growth.

Job First run Second run
macos-14 49s 43s
ubuntu-22.04 37s 21s
windows-2022 3m 43s 2m 18s

@MikeMcC399 MikeMcC399 added the type: enhancement New feature or request label Jul 29, 2024
@MikeMcC399 MikeMcC399 self-assigned this Jul 29, 2024
@cypress-app-bot
Copy link

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review July 29, 2024 15:33
@MikeMcC399
Copy link
Collaborator Author

@jennifer-shehane

This implements your suggestion to follow the pnpm documentation recommendations.

@jennifer-shehane jennifer-shehane merged commit 13042d4 into cypress-io:master Jul 29, 2024
74 checks passed
@MikeMcC399 MikeMcC399 deleted the pnpm-workflow-caching branch July 29, 2024 15:46
Copy link

🎉 This PR is included in version 6.7.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants