docs: recommend CYPRESS_INSTALL_BINARY=0 for cypress/included Docker image #1202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
If
cypress-io/github-action
is used to run a Cypress Docker image cypress/included as a container with--user 1001
(as recommended), then GitHub actions may report a caching error:Background
cypress/included Docker images include the Cypress binary installed in
/root/.cache/Cypress
with ownerroot
(see environment variableCYPRESS_CACHE_FOLDER
of Docker image).By default
cypress-io/github-action
attempts to cache and restore the Cypress binary. Any such restore action fails if the user has been set to a non-root value, since the owner of$CYPRESS_CACHE_FOLDER
isroot
.Caching the Cypress binary is superfluous when the Docker image already includes the binary.
If the environment variable
CYPRESS_INSTALL_BINARY=0
is set (see Skipping installation) thenisCypressBinarySkipped
is set internally in the action and noCYPRESS_BINARY_CACHE
is saved. If no cache is saved, thenrestoreCachedCypressBinary
will not be able to restore a cache and will not provoke any error condition.Note that this is not quite error proof because if a workflow has run without
CYPRESS_INSTALL_BINARY=0
and has stored a cache, then this will be picked up and provoke an error message. This is mitigated by the fact that the error is cosmetic, in that it does not cause the workflow to fail. It is also self-correcting since cache entries which have not been accessed in over 7 days are removed (see User limits and eviction policy).Change
Add advice to README > Docker image to set
CYPRESS_INSTALL_BINARY=0
with cypress/included Docker images.