Shallow Clone Cypress Repository in CI #28389
Closed
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.
Additional details
Workspaces are unique per workflow per commit. In this example the workspace paths are different for the same job and branch:
https://app.circleci.com/pipelines/github/cypress-io/cypress/58352/workflows/0756ee6f-133f-4f70-86cd-8105c65844f6/jobs/2422136/parallel-runs/0/steps/0-101
https://app.circleci.com/pipelines/github/cypress-io/cypress/58333/workflows/bb132359-8160-48cd-88aa-ff1b6d9954fd/jobs/2421644/parallel-runs/0/steps/0-101
The total workspace size for those two commits is not 1.7GB, but 3.4GB.
This now does a shallow clone with
--depth 1
, which clones only the last commit and not the entire commit history. This reduces the size of the workspace by 630MB (see first layer). Since the clone is done at the beginning of the workflow and attached to the workspace for future jobs: though it has a negligible effect on overall pipeline execution time, it should be a noticible improvement in cost for workspace persistence.Compare the size of the above workspaces to the one for this PR:
https://app.circleci.com/pipelines/github/cypress-io/cypress/58355/workflows/561d55a6-101d-470c-9b83-b137672dbc3b/jobs/2422279/parallel-runs/0/steps/0-101
How has the user experience changed?
See difference in size and download time in the above links.