version: 2.1 jobs: rspec: parameters: ruby_version: type: string gemfile: type: string docker: - image: cimg/ruby:<< parameters.ruby_version >> - image: cimg/mysql:8.0 environment: MYSQL_ALLOW_EMPTY_PASSWORD: 'true' MYSQL_ROOT_HOST: '%' - image: cimg/postgres:14.2 environment: POSTGRES_USER: postgres POSTGRES_HOST_AUTH_METHOD: trust environment: BUNDLE_GEMFILE: gemfiles/<< parameters.gemfile >> steps: - run: name: apt-get install command: | sudo apt-get update sudo apt-get install -y mysql-client - run: name: wait db command: | dockerize -wait tcp://127.0.0.1:3306 -wait tcp://127.0.0.1:5432 -timeout 1m - checkout - run: name: "bundle install" command: | bundle install - run: name: "run spec" command: | bundle exec rake test # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: ci: jobs: - rspec: matrix: parameters: ruby_version: ["2.6", "2.7", "3.0", "3.1"] gemfile: ["rails52.gemfile", "rails60.gemfile", "rails61.gemfile"] exclude: - ruby_version: "2.7" gemfile: "rails52.gemfile" - ruby_version: "3.0" gemfile: "rails52.gemfile" - ruby_version: "3.1" gemfile: "rails52.gemfile"