version: 2.1 jobs: lint: docker: - image: salsify/ruby_ci:2.7.7 working_directory: ~/avrolution steps: - checkout - restore_cache: keys: - v2-gems-ruby-2.7.7-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }} - v2-gems-ruby-2.7.7- - 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: v2-gems-ruby-2.7.7-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }} paths: - "vendor/bundle" - "gemfiles/vendor/bundle" - run: name: Run Rubocop command: bundle exec rubocop test: parameters: ruby-version: type: string docker: - image: salsify/ruby_ci:<< parameters.ruby-version >> environment: CIRCLE_TEST_REPORTS: "test-results" working_directory: ~/avrolution steps: - checkout - restore_cache: keys: - v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }} - v2-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: v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avrolution.gemspec" }}-{{ checksum "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" workflows: build: jobs: - lint - test: matrix: parameters: ruby-version: - "2.7.7" - "3.0.5" - "3.1.3" - "3.2.0"