test: remove pnpm store cache loose match restore-keys
- related to issue https://github.com/cypress-io/github-action/issues/1179
Issue
pnpm basic and workspaces workflows
include the use of the GitHub provided actions/cache action to cache dependencies installed by pnpm, with the input restore-keys set to a loose match in the form:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/xxx/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
This leads to non-deterministic outcomes of any jobs in the worksflows running on the same operating system in parallel, since the state of the GitHub caches in the branch concerned depends on the variable timing of other jobs which are running. Jobs which are exposed to this issue are:
-
basic-pnpm-ubuntu-20andbasic-pnpm-ubuntu-22jobs in the example-basic-pnpm.yml workflow - all jobs in the example-start-and-pnpm-workspaces.yml workflow
The non-deterministic behaviour is in contrast to the cypress-io/github-action which uses exact cache key matches.
- Possibly this is the cause of issue https://github.com/cypress-io/github-action/issues/1179 and in any case this change is a prerequisite to debugging the issue if it continues.
Change
Remove the option restore-keys from the workflows listed above and from the documentation examples in the README.
Correct also an error in example-start-and-pnpm-workspaces.yml where the cache was incorrectly using the lock file from examples/basic-pnpm instead of from examples/start-and-pnpm-workspaces.
Related issues
- https://github.com/cypress-io/github-action/issues/1044
- https://github.com/cypress-io/github-action/issues/1179
Related PRs
- https://github.com/cypress-io/github-action/pull/1043
- https://github.com/cypress-io/github-action/pull/1140
References
Verification
Downgrade the pnpm examples to Cypress 13.8.0
Run each workflow twice and confirm no errors.
Revert the pnpm examples to Cypress 13.9.0 and again run each workflow twice with no errors.
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
:tada: This PR is included in version 6.7.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: