version: 2.1 jobs: lint: docker: - image: salsify/ruby_ci:2.7.4 working_directory: ~/avromatic steps: - checkout - restore_cache: keys: - v2-gems-ruby-2.7.4-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }} - v2-gems-ruby-2.7.4- - 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.4-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }} paths: - "vendor/bundle" - "gemfiles/vendor/bundle" - run: name: Run Rubocop command: bundle exec rubocop test: parameters: gemfile: type: string ruby-version: type: string docker: - image: salsify/ruby_ci:<< parameters.ruby-version >> environment: CIRCLE_TEST_REPORTS: "test-results" BUNDLE_GEMFILE: << parameters.gemfile >> working_directory: ~/avromatic steps: - checkout - restore_cache: keys: - v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avromatic.gemspec" }}-{{ checksum "<< parameters.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 "avromatic.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" workflows: build: jobs: - lint - test: matrix: parameters: gemfile: - "gemfiles/avro1_10_rails5_2.gemfile" - "gemfiles/avro1_10_rails6_0.gemfile" - "gemfiles/avro1_10_rails6_1.gemfile" - "gemfiles/avro1_10_rails7_0.gemfile" - "gemfiles/avro1_11_rails7_0.gemfile" ruby-version: - "2.7.4" - test: matrix: parameters: gemfile: - "gemfiles/avro1_10_rails6_1.gemfile" - "gemfiles/avro1_10_rails7_0.gemfile" - "gemfiles/avro1_11_rails7_0.gemfile" ruby-version: - "3.0.3" - "3.1.0"