# Ruby CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-ruby/ for more details # version: 2.1 commands: build_and_run_tests: steps: - checkout # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "longleaf.gemspec" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: install dependencies command: | bin/setup - run: name: install rsync command: sudo apt install -y rsync - save_cache: paths: - ./.bundle key: v1-dependencies-{{ checksum "longleaf.gemspec" }} - run: name: run tests command: | mkdir /tmp/test-results TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb")" bundle exec rspec \ --format progress \ --format RspecJunitFormatter \ --out /tmp/test-results/rspec.xml \ --format progress \ $TEST_FILES # collect reports - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results - store_artifacts: path: coverage install_new_bundler: steps: - run: name: upgrade bundler command: | sudo gem update --system sudo gem uninstall bundler sudo rm /usr/local/bin/bundle sudo gem install bundler jobs: test_with_ruby_23: docker: - image: circleci/ruby:2.3 environment: BUNDLER_VERSION: 2.1.4 working_directory: ~/repo steps: - install_new_bundler - build_and_run_tests test_with_ruby_latest: docker: - image: circleci/ruby:latest environment: BUNDLER_VERSION: 2.1.4 working_directory: ~/repo steps: - build_and_run_tests workflows: version: 2.2 notify_deploy: jobs: - test_with_ruby_23 - test_with_ruby_latest