|
| 1 | +version: 2 |
| 2 | + |
| 3 | +workflows: |
| 4 | + version: 2 |
| 5 | + test: |
| 6 | + jobs: |
| 7 | + - test-misc-rubies |
| 8 | + - test-2.2 |
| 9 | + - test-2.3 |
| 10 | + - test-2.4 |
| 11 | + - test-2.5 |
| 12 | + - test-jruby-9.2 |
| 13 | + |
| 14 | +ruby-docker-template: &ruby-docker-template |
| 15 | + steps: |
| 16 | + - checkout |
| 17 | + - run: | |
| 18 | + if [[ $CIRCLE_JOB == test-jruby* ]]; then |
| 19 | + gem install jruby-openssl; # required by bundler, no effect on Ruby MRI |
| 20 | + fi |
| 21 | + - run: ruby -v |
| 22 | + - run: gem install bundler -v "~> 1.17" |
| 23 | + - run: bundle install |
| 24 | + - run: mkdir ./rspec |
| 25 | + - run: bundle exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec |
| 26 | + - store_test_results: |
| 27 | + path: ./rspec |
| 28 | + - store_artifacts: |
| 29 | + path: ./rspec |
| 30 | + |
| 31 | +jobs: |
| 32 | + test-2.2: |
| 33 | + <<: *ruby-docker-template |
| 34 | + docker: |
| 35 | + - image: circleci/ruby:2.2.10-jessie |
| 36 | + test-2.3: |
| 37 | + <<: *ruby-docker-template |
| 38 | + docker: |
| 39 | + - image: circleci/ruby:2.3.7-jessie |
| 40 | + test-2.4: |
| 41 | + <<: *ruby-docker-template |
| 42 | + docker: |
| 43 | + - image: circleci/ruby:2.4.5-stretch |
| 44 | + test-2.5: |
| 45 | + <<: *ruby-docker-template |
| 46 | + docker: |
| 47 | + - image: circleci/ruby:2.5.3-stretch |
| 48 | + test-jruby-9.2: |
| 49 | + <<: *ruby-docker-template |
| 50 | + docker: |
| 51 | + - image: circleci/jruby:9-jdk |
| 52 | + |
| 53 | + # The following very slow job uses an Ubuntu container to run the Ruby versions that |
| 54 | + # CircleCI doesn't provide Docker images for. |
| 55 | + test-misc-rubies: |
| 56 | + machine: |
| 57 | + image: circleci/classic:latest |
| 58 | + environment: |
| 59 | + - RUBIES: "jruby-9.1.17.0" |
| 60 | + steps: |
| 61 | + - checkout |
| 62 | + - run: |
| 63 | + name: install all Ruby versions |
| 64 | + command: "parallel rvm install ::: $RUBIES" |
| 65 | + - run: |
| 66 | + name: bundle install for all versions |
| 67 | + shell: /bin/bash -leo pipefail # need -l in order for "rvm use" to work |
| 68 | + command: | |
| 69 | + set -e; |
| 70 | + for i in $RUBIES; |
| 71 | + do |
| 72 | + rvm use $i; |
| 73 | + if [[ $i == jruby* ]]; then |
| 74 | + gem install jruby-openssl; # required by bundler, no effect on Ruby MRI |
| 75 | + fi |
| 76 | + gem install bundler -v "~> 1.17"; |
| 77 | + bundle install; |
| 78 | + mv Gemfile.lock "Gemfile.lock.$i" |
| 79 | + done |
| 80 | + - run: |
| 81 | + name: run tests for all versions |
| 82 | + shell: /bin/bash -leo pipefail |
| 83 | + command: | |
| 84 | + set -e; |
| 85 | + for i in $RUBIES; |
| 86 | + do |
| 87 | + rvm use $i; |
| 88 | + cp "Gemfile.lock.$i" Gemfile.lock; |
| 89 | + bundle exec rspec spec; |
| 90 | + done |
0 commit comments