version: 2.1 jobs: lint: docker: - image: salsify/ruby_ci:2.7.6 working_directory: ~/delayed_job_worker_pool steps: - checkout - restore_cache: keys: - v1-gems-ruby-2.7.6-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }} - v1-gems-ruby-2.7.6- - run: name: Install Gems command: | if ! bundle check --path=vendor/bundle; then bundle install --path=vendor/bundle --jobs=4 --retry=3 bundle clean fi - save_cache: key: v1-gems-ruby-2.7.6-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }} paths: - "vendor/bundle" - "gemfiles/vendor/bundle" - run: name: Run Rubocop command: bundle exec rubocop --config .rubocop.yml test: parameters: ruby_version: type: string gemfile: type: string docker: - image: salsify/ruby_ci:<< parameters.ruby_version >> environment: CIRCLE_TEST_REPORTS: "test-results" BUNDLE_GEMFILE: "~/delayed_job_worker_pool/<< parameters.gemfile >>" working_directory: ~/delayed_job_worker_pool steps: - checkout - restore_cache: keys: - v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }} - v1-gems-ruby-<< parameters.ruby_version >>- - run: name: Install Gems command: | if ! bundle check --path=vendor/bundle; then bundle install --path=vendor/bundle --jobs=4 --retry=3 bundle clean fi - save_cache: key: v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }} paths: - "vendor/bundle" - "gemfiles/vendor/bundle" - run: name: Run Tests command: | bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec - store_test_results: path: "test-results" - store_artifacts: path: "tmp/log/" workflows: build: jobs: - lint - test: matrix: parameters: gemfile: - "gemfiles/rails_6.0.gemfile" - "gemfiles/rails_6.1.gemfile" - "gemfiles/rails_7.0.gemfile" ruby_version: - "2.7.6" - "3.0.4" - "3.1.2"