|
| 1 | +services: |
| 2 | + # Base service definition for Ruby 3.1.5 (Rails 6.1-8.1) |
| 3 | + test-base: &test-base |
| 4 | + build: |
| 5 | + context: . |
| 6 | + dockerfile: Dockerfile.ruby3.1 |
| 7 | + volumes: |
| 8 | + - .:/app |
| 9 | + - bundle-cache-ruby31:/usr/local/bundle |
| 10 | + working_dir: /app |
| 11 | + stdin_open: true |
| 12 | + tty: true |
| 13 | + |
| 14 | + # Base service definition for Ruby 2.7 (Rails 5.1-6.0) |
| 15 | + test-base-ruby27: &test-base-ruby27 |
| 16 | + build: |
| 17 | + context: . |
| 18 | + dockerfile: Dockerfile.ruby2.7 |
| 19 | + volumes: |
| 20 | + - .:/app |
| 21 | + - bundle-cache-ruby27:/usr/local/bundle |
| 22 | + working_dir: /app |
| 23 | + stdin_open: true |
| 24 | + tty: true |
| 25 | + |
| 26 | + # Base service definition for Ruby 3.4 (Rails 8.0-8.1) |
| 27 | + test-base-ruby34: &test-base-ruby34 |
| 28 | + build: |
| 29 | + context: . |
| 30 | + dockerfile: Dockerfile.ruby3.4 |
| 31 | + volumes: |
| 32 | + - .:/app |
| 33 | + - bundle-cache-ruby34:/usr/local/bundle |
| 34 | + working_dir: /app |
| 35 | + stdin_open: true |
| 36 | + tty: true |
| 37 | + |
| 38 | + # Rails 5.1.7 |
| 39 | + rails-5.1: |
| 40 | + <<: *test-base-ruby27 |
| 41 | + container_name: jsonapi-rails-5.1 |
| 42 | + environment: |
| 43 | + - RAILS_VERSION=5.1.7 |
| 44 | + command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test" |
| 45 | + |
| 46 | + # Rails 5.2.8.1 |
| 47 | + rails-5.2: |
| 48 | + <<: *test-base-ruby27 |
| 49 | + container_name: jsonapi-rails-5.2 |
| 50 | + environment: |
| 51 | + - RAILS_VERSION=5.2.8.1 |
| 52 | + command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test" |
| 53 | + |
| 54 | + # Rails 6.0.6 |
| 55 | + rails-6.0: |
| 56 | + <<: *test-base-ruby27 |
| 57 | + container_name: jsonapi-rails-6.0 |
| 58 | + environment: |
| 59 | + - RAILS_VERSION=6.0.6 |
| 60 | + command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test" |
| 61 | + |
| 62 | + # Rails 6.1.7.10 |
| 63 | + rails-6.1: |
| 64 | + <<: *test-base |
| 65 | + container_name: jsonapi-rails-6.1 |
| 66 | + environment: |
| 67 | + - RAILS_VERSION=6.1.7.10 |
| 68 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 69 | + |
| 70 | + # Rails 7.0.10 |
| 71 | + rails-7.0: |
| 72 | + <<: *test-base |
| 73 | + container_name: jsonapi-rails-7.0 |
| 74 | + environment: |
| 75 | + - RAILS_VERSION=7.0.10 |
| 76 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 77 | + |
| 78 | + # Rails 7.1.6 |
| 79 | + rails-7.1: |
| 80 | + <<: *test-base |
| 81 | + container_name: jsonapi-rails-7.1 |
| 82 | + environment: |
| 83 | + - RAILS_VERSION=7.1.6 |
| 84 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 85 | + |
| 86 | + # Rails 7.2.3 |
| 87 | + rails-7.2: |
| 88 | + <<: *test-base |
| 89 | + container_name: jsonapi-rails-7.2 |
| 90 | + environment: |
| 91 | + - RAILS_VERSION=7.2.3 |
| 92 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 93 | + |
| 94 | + # Rails 8.0.4 (Ruby 3.4 required) |
| 95 | + rails-8.0: |
| 96 | + <<: *test-base-ruby34 |
| 97 | + container_name: jsonapi-rails-8.0 |
| 98 | + environment: |
| 99 | + - RAILS_VERSION=8.0.4 |
| 100 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 101 | + |
| 102 | + # Rails 8.1.2 (Ruby 3.4 required) |
| 103 | + rails-8.1: |
| 104 | + <<: *test-base-ruby34 |
| 105 | + container_name: jsonapi-rails-8.1 |
| 106 | + environment: |
| 107 | + - RAILS_VERSION=8.1.2 |
| 108 | + command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test" |
| 109 | + |
| 110 | + # Interactive shell for debugging (defaults to Rails 8.1) |
| 111 | + shell: |
| 112 | + <<: *test-base |
| 113 | + container_name: jsonapi-shell |
| 114 | + environment: |
| 115 | + - RAILS_VERSION=${RAILS_VERSION:-8.1.2} |
| 116 | + command: /bin/bash |
| 117 | + |
| 118 | +volumes: |
| 119 | + bundle-cache-ruby31: |
| 120 | + bundle-cache-ruby27: |
| 121 | + bundle-cache-ruby34: |
0 commit comments