Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Ci gem caching #101

Merged
merged 9 commits into from
Jan 6, 2020
Merged

Ci gem caching #101

merged 9 commits into from
Jan 6, 2020

Conversation

jjtechuy
Copy link

@jjtechuy jjtechuy commented Jan 3, 2020

What

  • Modified CircleCI configuration to cache ruby gems installed by bundle, based on hash of Gemfile.lock

Why

  • This is expected to reduce installation time during each job execution
  • Results: Previously build times were ~ 4 minutes, now they are ~ 30 seconds

Refs

@alebanzas alebanzas added the do NOT merge PR considered to be ready, reviewed, not ready to merge label Jan 3, 2020
Juan Techera added 2 commits January 3, 2020 11:39
@bguiz bguiz force-pushed the ci-gem-caching branch 23 times, most recently from f9261a5 to c9c9ec7 Compare January 4, 2020 09:54
@bguiz bguiz force-pushed the ci-gem-caching branch 9 times, most recently from 6ac94fc to f7657cd Compare January 4, 2020 10:21
@bguiz bguiz force-pushed the ci-gem-caching branch 2 times, most recently from 223d401 to e1b54ca Compare January 4, 2020 10:33
@bguiz bguiz added ready for review PR considered to be ready for review and removed do NOT merge PR considered to be ready, reviewed, not ready to merge labels Jan 4, 2020
@bguiz bguiz requested review from a team, solangegueiros and alebanzas and removed request for a team January 4, 2020 10:43
@@ -0,0 +1,280 @@
GEM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Gemfile.lock was previously .gitignore'd, but now we're committing it.
Rationale: CI is using the hash of the Gemfile to determine cache equivalency, and therefore when to save and restore

- run:
name: Set up bundle gems
command: |
bundle check || bundle install --jobs=4 --retry=3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The || bash operator here means that if bundle check passes, we skip bundle install. The check will pass when all available dependencies are already installed, which should happen when a cache is restored successfully.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed/Approved. Please go ahead and merge this PR.

@bguiz bguiz removed the ready for review PR considered to be ready for review label Jan 6, 2020
@bguiz bguiz merged commit 957667d into master Jan 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the ci-gem-caching branch January 6, 2020 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants