cache paralell tests log on ci

This commit is contained in:
hyuraku 2021-04-01 23:15:51 +09:00
parent 2dc86a28a9
commit 0ebc90ee67
2 changed files with 16 additions and 2 deletions

View File

@ -201,6 +201,13 @@ jobs:
- name: Install Bundler RubyGems
run: brew install-bundler-gems
- name: Cache parallel tests log
uses: actions/cache@v1
with:
path: /tests/parallel_runtime_rspec.log
key: ${{ runner.os }}-parallel_runtime_rspec-${{ hashFiles('**/parallel_runtime_rspec.log') }}
restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log
- name: Run brew tests
run: |
# brew tests doesn't like world writable directories

View File

@ -98,10 +98,17 @@ module Homebrew
Dir.glob("test/**/*_spec.rb")
end
parallel_rspec_log_path =if ENV["CI"]
"/tests/parallel_runtime_rspec.log"
else
"#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log"
end
parallel_args = if ENV["CI"]
%w[
%W[
--combine-stderr
--serialize-stdout
--runtime-log "#{parallel_rspec_log_path}"
]
else
%w[
@ -120,7 +127,7 @@ module Homebrew
--require spec_helper
--format NoSeedProgressFormatter
--format ParallelTests::RSpec::RuntimeLogger
--out #{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log
--out #{parallel_rspec_log_path}
]
bundle_args << "--format" << "RSpec::Github::Formatter" if ENV["GITHUB_ACTIONS"]