Skip to content

Commit

Permalink
Merge pull request fastlane#4329 from fastlane/cache-all-the-things
Browse files Browse the repository at this point in the history
Improve caching by running bundle install for all tools in the dependencies phase of CI
  • Loading branch information
mfurtak committed Apr 22, 2016
2 parents 8878d6a + 3c211ce commit 22d739a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ machine:
version: "7.3"
dependencies:
override:
- bundle check --path=~/.fastlane_bundle || bundle install --path=~/.fastlane_bundle --jobs=4 --retry=3
- rake bundle_install_all
cache_directories:
- ~/.fastlane_bundle
test:
Expand Down
14 changes: 12 additions & 2 deletions rakelib/test_all.rake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ def bundle_install
sh "bundle check#{path} || bundle install#{path} --jobs=4 --retry=3"
end

task :bundle_install_all do
puts "Fetching dependencies in the root"
bundle_install

for_each_gem do |repo|
Dir.chdir(repo) do
puts "Fetching dependencies for #{repo}"
bundle_install
end
end
end

def get_line_from_file(line_number, file)
File.open(file) do |io|
io.each_with_index do |line, index|
Expand All @@ -66,7 +78,6 @@ task :test_all do
repos_with_exceptions = []
rspec_log_file = "rspec_logs.json"

bundle_install
for_each_gem do |repo|
box "Testing #{repo}"
Dir.chdir(repo) do
Expand All @@ -85,7 +96,6 @@ task :test_all do
rspec_command_parts << "--format RspecJunitFormatter --out #{output_file}"
end

bundle_install
sh rspec_command_parts.join(' ')
sh "bundle exec rubocop"
end
Expand Down

0 comments on commit 22d739a

Please sign in to comment.