# Ruby CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-ruby/ for more details # version: 2 jobs: build: working_directory: ~/app docker: - image: circleci/ruby:2.5.3-node environment: steps: - checkout - run: name: install dependencies command: | bundle install --jobs=4 --retry=3 --path vendor/bundle - run: name: run linting command: | git config --global user.email $CIRCLE_USERNAME@none.com && \ git config --global user.name "$CIRCLE_USERNAME @$CIRCLE_PROJECT_REPONAME" && \ bundle exec overcommit --sign && \ bundle exec overcommit --run # run tests! - run: name: run tests command: | mkdir /tmp/test-results COVERAGE=true bundle exec rspec --format progress \ --format RspecJunitFormatter \ --out /tmp/test-results/rspec.xml \ --format progress # collect reports - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results - store_artifacts: path: ~/app/coverage destination: coverage-results deploy: working_directory: ~/app docker: - image: circleci/ruby:2.5.3-node environment: steps: - checkout # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "Gemfile.lock" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: install dependencies command: | bundle install --jobs=4 --retry=3 --path vendor/bundle - save_cache: paths: - ./vendor/bundle key: v1-dependencies-{{ checksum "Gemfile.lock" }} - run: name: Setup Rubygems command: bash .circleci/setup-rubygems.sh - run: name: Publish new version of the gem command: | git config --global user.email denis.pasin+circleci@gmail.com && \ git config --global user.name "Denis Pasin" && \ rake release workflows: version: 2 build-and-deploy: jobs: - build - deploy: requires: - build filters: branches: only: master