version: 2.1 jobs: test: parameters: image: type: string gemfile: type: string docker: - image: '<< parameters.image >>' auth: username: alassek password: $DOCKERHUB_TOKEN - image: circleci/postgres:10 auth: username: alassek password: $DOCKERHUB_TOKEN environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: "" POSTGRES_HOST_AUTH_METHOD: trust environment: BUNDLER_VERSION: "1.17.3" BUNDLE_GEMFILE: '<< parameters.gemfile >>' BUNDLE_JOBS: "3" BUNDLE_RETRY: "3" PGHOST: 127.0.0.1 PGUSER: postgres PGPASSWORD: "" TEST_USER: postgres steps: - checkout - run: name: Generate checksums command: | mkdir -p tmp shasum gemfiles/*.lock > tmp/checksum.txt - restore_cache: key: v1-gem-cache-{{ checksum "tmp/checksum.txt" }} - run: name: Install Dependencies command: | gem install bundler:$BUNDLER_VERSION bundle check --path ./vendor/bundle || bundle install --deployment - run: name: Wait for DB command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Run RSpec Tests command: bundle exec rake spec workflows: rails_4_1: jobs: - test: name: Rails 4.1 image: 'circleci/ruby:2.2.6' gemfile: 'gemfiles/4.1.gemfile' rails_4_2: jobs: - test: name: Rails 4.2 image: 'circleci/ruby:2.2.10' gemfile: 'gemfiles/4.2.gemfile' rails_5_0: jobs: - test: name: Rails 5.0 image: 'circleci/ruby:2.3.8' gemfile: 'gemfiles/5.0.gemfile' rails_5_1: jobs: - test: name: Rails 5.1 image: 'circleci/ruby:2.4.4' gemfile: 'gemfiles/5.1.gemfile' rails_6_0: jobs: - test: name: Rails 6.0 image: 'circleci/ruby:2.6.0' gemfile: 'gemfiles/6.0.gemfile' rails_6_1: jobs: - test: name: Rails 6.1 image: 'circleci/ruby:3.0.1' gemfile: 'gemfiles/6.1.gemfile' rails_7_0: jobs: - test: name: Rails 7.0 image: 'cimg/ruby:2.7.6' gemfile: 'gemfiles/7.0.gemfile'