Skip to content

Instantly share code, notes, and snippets.

@nisevi
Created May 3, 2019 04:42
Show Gist options
  • Save nisevi/c18092e199357515ecbfa336e417d48d to your computer and use it in GitHub Desktop.
Save nisevi/c18092e199357515ecbfa336e417d48d to your computer and use it in GitHub Desktop.
Basic RSpec coverage with CircleCI
version: 2.1
commands:
cached-bundle:
steps:
- restore_cache:
keys:
- gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-cache-v1-{{ arch }}-{{ .Branch }}
- gem-cache-v1
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
rspec-tests:
steps:
- run: |
bundle exec rspec \
--profile 10 \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
executors:
ruby-2-6-2:
docker:
- image: circleci/ruby:2.6.2
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
jobs:
build:
working_directory: ~/app
executor: ruby-2-6-2
steps:
- checkout
- cached-bundle
- rspec-tests
workflows:
main:
jobs:
- build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment