Last active
June 7, 2019 19:12
-
-
Save MothOnMars/1c4ef90e33d5b23691874f4c0fdd72fe to your computer and use it in GitHub Desktop.
Run specs against multiple Ruby versions in CircleCi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#.circleci/config.yml | |
version: 2.1 | |
executors: | |
test_executor: | |
docker: | |
- image: circleci/ruby:${RUBY_VERSION} | |
working_directory: ~/app | |
jobs: | |
build: | |
environment: | |
RUBY_VERSION: << parameters.ruby_version >> | |
executor: test_executor | |
parameters: | |
ruby_version: | |
type: string | |
steps: | |
- checkout | |
- restore_cache: | |
key: bundle-{{ checksum "Gemfile.lock" }} | |
- run: bundle check || bundle install --path vendor/bundle | |
- run: rubocop | |
- save_cache: | |
key: bundle-{{ checksum "Gemfile.lock" }} | |
paths: | |
- ~/app/vendor/bundle | |
- run: | |
name: RSpec | |
command: bundle exec rspec spec | |
workflows: | |
build_and_test: | |
jobs: | |
- build: | |
name: 'ruby 2.4.5' | |
ruby_version: 2.4.5 | |
- build: | |
name: 'ruby 2.5.5' | |
ruby_version: 2.5.5 | |
- build: | |
name: 'ruby 2.6.2' | |
ruby_version: 2.6.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment