version: 2.1 defaults: &defaults working_directory: ~/tempo-ruby docker: - image: cimg/ruby:<< parameters.ruby-version >> orbs: ruby: circleci/ruby@1.2.0 references: restore_bundle_cache: &restore_bundle_cache restore_cache: keys: - ruby-smtp-mock-{{ checksum "tempo-ruby.gemspec" }} bundle_install: &bundle_install run: name: Installing gems command: | bundle config set --local path 'vendor/bundle' bundle install save_bundle_cache: &save_bundle_cache save_cache: key: ruby-smtp-mock-{{ checksum "tempo-ruby.gemspec" }} paths: - vendor/bundle jobs: linters-ruby: parameters: ruby-version: type: string <<: *defaults steps: - checkout - <<: *restore_bundle_cache - <<: *bundle_install - <<: *save_bundle_cache - run: name: Running Overcommit command: | bundle exec overcommit -s SKIP=AuthorEmail,AuthorName bundle exec overcommit -r tests-ruby: parameters: ruby-version: type: string <<: *defaults steps: - checkout - <<: *restore_bundle_cache - <<: *bundle_install - <<: *save_bundle_cache - run: name: Running RSpec command: bundle exec rspec - store_artifacts: name: Saving Simplecov coverage artifacts path: ~/ruby-smtp-mock/coverage destination: coverage compatibility-ruby: parameters: ruby-version: type: string docker: - image: cimg/ruby:<< parameters.ruby-version >> steps: - checkout - ruby/install-deps: bundler-version: "2.3.4" with-cache: false path: './vendor/custom_bundle' - run: name: Running compatibility tests command: bundle exec rspec workflows: build_and_test: jobs: - linters-ruby: matrix: parameters: ruby-version: [ "2.7" ] - tests-ruby: matrix: parameters: ruby-version: [ "2.7" ] - compatibility-ruby: matrix: parameters: ruby-version: ["3.0", "3.1" ]