github-action icon indicating copy to clipboard operation
github-action copied to clipboard

test: remove pnpm store cache loose match restore-keys

Open MikeMcC399 opened this issue 1 year ago • 1 comments

  • 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:

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.

MikeMcC399 avatar May 11 '24 14:05 MikeMcC399

cypress-app-bot avatar May 11 '24 14:05 cypress-app-bot

:tada: This PR is included in version 6.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 31 '24 03:05 github-actions[bot]