.circleci/config.yml
version: 2
jobs:
setup:
docker: &docker
- image: circleci/ruby:2.5.3-node
environment:
BUNDLE_PATH: vendor/bundle
steps:
- checkout
- run:
name: Check if Ruby versions match
command: test "$(ruby -v | grep -oP '\d\.\d\.\d')" = "$(cat .ruby-version)"
- run:
name: Install dependencies
command: bundle install --jobs=4 --retry=3
- persist_to_workspace:
root: .
paths:
- .
lint:
docker: *docker
steps:
- attach_workspace:
at: .
- run: bundle exec rake rubocop_ci:rubocop:diff
test:
docker: *docker
steps:
- attach_workspace:
at: .
- run:
name: run tests
command: |
mkdir /tmp/test-results
bundle exec rspec --format progress \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress
- store_test_results:
path: /tmp/test-results
workflows:
version: 2
lint-and-test:
jobs:
- setup
- lint:
requires:
- setup
- test:
requires:
- setup