Skip to content

Comments

test: add npm caching to pnpm examples#1043

Merged
mschile merged 1 commit intocypress-io:masterfrom
MikeMcC399:pnpm-cached
Oct 23, 2023
Merged

test: add npm caching to pnpm examples#1043
mschile merged 1 commit intocypress-io:masterfrom
MikeMcC399:pnpm-cached

Conversation

@MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Sep 27, 2023

If cypress-io/github-action finds a pnpm-lock.yaml file, it uses the pnpm command pnpm install --frozen-lockfile by default to install dependencies. It does not however cache these dependencies for a future run of the same workflow.

This PR is a workaround to the pnpm example to make up for this missing functionality.

It adds dependency caching of the pnpm store contents using the command pnpm store path to find the location of the store and actions/cache to cache the store contents. This is applied to

There is no change to the action itself.

Verification

Run the workflow example-basic-pnpm.yml.

Check that each of the caches under github-action/actions/caches

  • macOS-pnpm-store-*
  • Linux-pnpm-store-*
  • Windows-pnpm-store-*

is approximately 6MB large.

Run the workflow example-basic-pnpm.yml again.

Check the logs files and examine each job.

  • basic-pnpm-ubuntu-20
  • basic-pnpm-ubuntu-22
  • basic-pnpm-on-windows
  • basic-pnpm-on-mac
  • basic-pnpm-binary

Under the step "Cypress tests" look for the line

Progress: resolved 179, reused 179, downloaded 0, added 179, done

The number next to downloaded must be 0.

@cypress-app-bot
Copy link

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Collaborator Author

@davidr-cy

Are you intending to review this PR?

@jennifer-shehane jennifer-shehane removed the request for review from davidr-cy October 17, 2023 16:15
@davidr-cy
Copy link

@MikeMcC399 Sorry about that. I think we tagged the wrong person to review this!

Thanks for the ping, I'll get that sorted out.

@mschile mschile merged commit ba9956d into cypress-io:master Oct 23, 2023
@MikeMcC399 MikeMcC399 deleted the pnpm-cached branch October 24, 2023 05:12
@github-actions
Copy link

🎉 This PR is included in version 6.6.0 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants