|
1 | | -version: 2 |
| 1 | +version: 2.1 |
2 | 2 |
|
3 | 3 | workflows: |
4 | 4 | version: 2 |
5 | 5 | test: |
6 | 6 | jobs: |
7 | | - - test-2.5 |
8 | | - - test-2.6 |
9 | | - - test-2.7 |
10 | | - - test-3.0 |
11 | | - - test-jruby-9.2 |
12 | | - |
13 | | -ruby-docker-template: &ruby-docker-template |
14 | | - steps: |
15 | | - - checkout |
16 | | - - run: | |
17 | | - if [[ $CIRCLE_JOB == test-jruby* ]]; then |
18 | | - gem install jruby-openssl; # required by bundler, no effect on Ruby MRI |
19 | | - sudo apt-get update -y && sudo apt-get install -y build-essential |
20 | | - fi |
21 | | - - run: ruby -v |
22 | | - - run: gem install bundler |
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 |
| 7 | + - build-test-linux: |
| 8 | + name: Ruby 2.5 |
| 9 | + docker-image: cimg/ruby:2.5 |
| 10 | + - build-test-linux: |
| 11 | + name: Ruby 2.6 |
| 12 | + docker-image: cimg/ruby:2.6 |
| 13 | + - build-test-linux: |
| 14 | + name: Ruby 2.7 |
| 15 | + docker-image: cimg/ruby:2.7 |
| 16 | + - build-test-linux: |
| 17 | + name: Ruby 3.0 |
| 18 | + docker-image: cimg/ruby:3.0 |
| 19 | + - build-test-linux: |
| 20 | + name: JRuby 9.2 |
| 21 | + docker-image: circleci/jruby:9.2-jdk |
| 22 | + jruby: true |
30 | 23 |
|
31 | 24 | jobs: |
32 | | - test-2.5: |
33 | | - <<: *ruby-docker-template |
34 | | - docker: |
35 | | - - image: circleci/ruby:2.5 |
36 | | - - image: consul |
37 | | - - image: redis |
38 | | - - image: amazon/dynamodb-local |
39 | | - test-2.6: |
40 | | - <<: *ruby-docker-template |
41 | | - docker: |
42 | | - - image: circleci/ruby:2.6 |
43 | | - - image: consul |
44 | | - - image: redis |
45 | | - - image: amazon/dynamodb-local |
46 | | - test-2.7: |
47 | | - <<: *ruby-docker-template |
48 | | - docker: |
49 | | - - image: circleci/ruby:2.7 |
50 | | - - image: consul |
51 | | - - image: redis |
52 | | - - image: amazon/dynamodb-local |
53 | | - test-3.0: |
54 | | - <<: *ruby-docker-template |
55 | | - docker: |
56 | | - - image: circleci/ruby:3.0 |
57 | | - - image: consul |
58 | | - - image: redis |
59 | | - - image: amazon/dynamodb-local |
60 | | - test-jruby-9.2: |
61 | | - <<: *ruby-docker-template |
| 25 | + build-test-linux: |
| 26 | + parameters: |
| 27 | + docker-image: |
| 28 | + type: string |
| 29 | + jruby: |
| 30 | + type: boolean |
| 31 | + default: false |
| 32 | + |
62 | 33 | docker: |
63 | | - - image: circleci/jruby:9.2-jdk |
| 34 | + - image: <<parameters.docker-image>> |
64 | 35 | - image: consul |
65 | 36 | - image: redis |
66 | 37 | - image: amazon/dynamodb-local |
| 38 | + |
| 39 | + steps: |
| 40 | + - checkout |
| 41 | + - when: |
| 42 | + condition: <<parameters.jruby>> |
| 43 | + steps: |
| 44 | + - run: gem install jruby-openssl # required by bundler, no effect on Ruby MRI |
| 45 | + - run: sudo apt-get update -y && sudo apt-get install -y build-essential |
| 46 | + - run: ruby -v |
| 47 | + - run: gem install bundler -v 2.2.10 |
| 48 | + - run: bundle _2.2.10_ install |
| 49 | + - run: mkdir ./rspec |
| 50 | + - run: bundle _2.2.10_ exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec |
| 51 | + - store_test_results: |
| 52 | + path: ./rspec |
| 53 | + - store_artifacts: |
| 54 | + path: ./rspec |
0 commit comments