azure-pipelines-templates/steps-macos.yml
steps:
- task: Cache@2
inputs:
key: 'ruby | "$(Agent.JobName)" | "$(rubyVersion)"'
path: $(rubyPath)
cacheHitVar: rubyCacheRestored
displayName: 'Cache Ruby'
- script: |
brew update
brew install ruby-build
condition: ne(variables.rubyCacheRestored, 'true')
displayName: 'Install ruby-build'
- script: |
export SYSTEM=`uname -s` ./config
ruby-build $(rubyVersion) $(rubyPath)
condition: ne(variables.rubyCacheRestored, 'true')
displayName: 'Install Ruby'
- script: |
if [[ $(rubyVersion) =~ 2\.[0-2]\.[0-9]+ ]]; then
$(gemBinPath)/gem install bundler --no-document -v '<2'
else
$(gemBinPath)/gem install bundler --no-document
fi
displayName: 'Install bundler'
- script: |
$(gemBinPath)/bundle install --retry=3 --jobs=4
displayName: 'Install gems'
- script: |
$(gemBinPath)/bundle exec $(gemBinPath)/rake
displayName: 'Run test'