version: 2.1 orbs: ruby: circleci/ruby@1.0 workflows: test: jobs: - test: name: "Sphinx 2.2" sphinx_version: 2.2.11 sphinx_engine: sphinx debian: jessie ruby: '2.4.6' matrix: parameters: database: [ 'mysql2', 'postgresql' ] rails: [ '4_2', '5_0', '5_1', '5_2' ] jobs: test: parameters: ruby: type: string rails: type: string database: type: string sphinx_version: type: string sphinx_engine: type: string debian: type: string docker: - image: circleci/ruby:<< parameters.ruby >>-<< parameters.debian >> - image: circleci/postgres:10 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: thinking_sphinx POSTGRES_DB: thinking_sphinx - image: circleci/mysql:5.7 environment: MYSQL_ROOT_PASSWORD: thinking_sphinx MYSQL_DATABASE: thinking_sphinx working_directory: ~/app steps: - checkout - restore_cache: keys: - v1-dependencies-<< parameters.ruby >>-<< parameters.rails >> - run: name: install bundler command: | export BUNDLER_VERSION=1.17.3 export BUNDLE_PATH=vendor/bundle gem install bundler:$BUNDLER_VERSION - run: name: install dependencies command: | bundle install --jobs=4 --retry=3 --path vendor/bundle bundle update - run: name: set up appraisal command: bundle exec appraisal generate - run: name: update gems environment: BUNDLE_GEMFILE: "./gemfiles/rails_<< parameters.rails >>.gemfile" command: bundle update - save_cache: paths: - ./vendor/bundle key: v1-dependencies-<< parameters.ruby >>-<< parameters.rails >> - run: name: set up sphinx command: "./bin/loadsphinx << parameters.sphinx_version >> << parameters.sphinx_engine >>" - run: name: tests environment: CI: "true" DATABASE: << parameters.database >> SPHINX_VERSION: << parameters.sphinx_version >> SPHINX_ENGINE: << parameters.sphinx_engine >> BUNDLE_GEMFILE: "./gemfiles/rails_<< parameters.rails >>.gemfile" command: bundle exec rspec