cypress-io / github-action

GitHub Action for running Cypress end-to-end & component tests
https://on.cypress.io/guides/continuous-integration/github-actions
MIT License
1.35k stars 357 forks source link

test: remove pnpm store cache loose match restore-keys #1180

Closed MikeMcC399 closed 3 months ago

MikeMcC399 commented 3 months ago

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.

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

Related PRs

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.

cypress-app-bot commented 3 months ago
github-actions[bot] commented 3 months ago

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

The release is available on:

Your semantic-release bot :package::rocket: