version: 2 references: steps: &steps - checkout - type: shell name: Write RAILS_VERSION to a file so we can use it for caching purposes command: echo "$RAILS_VERSION" > ~/RAILS_VERSION.txt - type: cache-restore key: coach-bundler-{{ checksum "coach.gemspec" }}-{{ checksum "~/RAILS_VERSION.txt" }} - run: gem install bundler - run: bundle install --path vendor/bundle - type: cache-save key: coach-bundler-{{ checksum "coach.gemspec" }}-{{ checksum "~/RAILS_VERSION.txt" }} paths: - vendor/bundle - type: shell command: | bundle exec rspec --profile 10 \ --format RspecJunitFormatter \ --out /tmp/test-results/rspec.xml \ --format progress \ spec - type: store_test_results path: /tmp/test-results - run: bundle exec rubocop jobs: build-ruby22-rails515: docker: - image: ruby:2.2 environment: - RAILS_VERSION=5.1.5 steps: *steps build-ruby22-rails4210: docker: - image: ruby:2.2 environment: - RAILS_VERSION=4.2.10 steps: *steps build-ruby23-rails515: docker: - image: ruby:2.3 environment: - RAILS_VERSION=5.1.5 steps: *steps build-ruby23-rails4210: docker: - image: ruby:2.3 environment: - RAILS_VERSION=4.2.10 steps: *steps build-ruby24-rails515: docker: - image: ruby:2.4 environment: - RAILS_VERSION=5.1.5 steps: *steps build-ruby24-rails4210: docker: - image: ruby:2.4 environment: - RAILS_VERSION=4.2.10 steps: *steps build-ruby25-rails515: docker: - image: ruby:2.5 environment: - RAILS_VERSION=5.1.5 steps: *steps build-ruby25-rails4210: docker: - image: ruby:2.5 environment: - RAILS_VERSION=4.2.10 steps: *steps workflows: version: 2 tests: jobs: - build-ruby22-rails515 - build-ruby22-rails4210 - build-ruby23-rails515 - build-ruby23-rails4210 - build-ruby24-rails515 - build-ruby24-rails4210 - build-ruby25-rails515 - build-ruby25-rails4210