Skip to content

Commit

Permalink
Update circle.yml for CircleCI 2.0 (#20)
Browse files Browse the repository at this point in the history
* Update circle.yml for CircleCI 2.0

* Upgrade ruby to 2.5.0

* Add rspec_junit_formatter for Circle
  • Loading branch information
randallreedjr committed Aug 31, 2018
1 parent 06e2642 commit 1b69f07
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
2.1.2
2.5.0
5 changes: 5 additions & 0 deletions Gemfile
@@ -1,5 +1,8 @@
source "https://rubygems.org/"

# Read ruby version from .ruby-version file
ruby File.read('.ruby-version', mode: 'rb').chomp

gem 'sinatra', '1.4.5'
gem 'tilt', '1.4.1'
gem 'rack', '~>1.5.4'
Expand All @@ -11,6 +14,8 @@ gem 'thin', '~>1.7.0'
group :development, :test do
gem 'rspec', '3.0.0'
gem 'rspec-core', '3.0.1'
# Needed by CircleCI for test results
gem 'rspec_junit_formatter'
gem 'rack-test'
gem 'byebug'
end
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Expand Up @@ -51,3 +51,9 @@ DEPENDENCIES
sinatra (= 1.4.5)
thin (~> 1.7.0)
tilt (= 1.4.1)

RUBY VERSION
ruby 2.5.0p0

BUNDLED WITH
1.16.2
63 changes: 58 additions & 5 deletions circle.yml
@@ -1,5 +1,58 @@
deployment:
production:
branch: master
heroku:
appname: getto24-sinatra
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.5.0

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo

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: |
gem install bundler
bundle install --jobs=4 --retry=3 --path vendor/bundle
# - save_cache:
# paths:
# - ./vendor/bundle
# key: v1-dependencies-{{ checksum "Gemfile.lock" }}

# run tests!
- run:
name: run tests
command: |
mkdir /tmp/test-results
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
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

0 comments on commit 1b69f07

Please sign in to comment.