.circleci/config.yml in itunes_api-2.3.2 vs .circleci/config.yml in itunes_api-2.4.0
- old
+ new
@@ -1,42 +1,46 @@
-version: 2
-jobs:
- build:
- docker:
- - image: circleci/ruby:2.5.1-node-browsers
-
- working_directory: ~/repo
-
- steps:
- - checkout
-
- - restore_cache:
- keys:
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
- - 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: 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 \
- --out /tmp/test-results/rspec.xml \
- --format progress \
- $TEST_FILES
-
- - store_test_results:
- path: /tmp/test-results
- - store_artifacts:
- path: /tmp/test-results
- destination: test-results
\ No newline at end of file
+---
+version: 2
+jobs:
+ build:
+ environment:
+ CC_TEST_REPORTER_ID: '259b37cf1fd88604007648fdd1a3df71a73ee30c4bc935f03d10a6d3e38ac964'
+ working_directory: ~/itunes-api
+ docker:
+ - image: circleci/ruby:2.5.1-node-browsers
+ steps:
+ - checkout
+
+ # Restore Cached Dependencies
+ - type: cache-restore
+ name: Restore bundle cache
+ key: itunes-api-{{ checksum "Gemfile.lock" }}
+
+ # Bundle install dependencies
+ - run: bundle install --path vendor/bundle
+
+ # Cache Dependencies
+ - type: cache-save
+ name: Store bundle cache
+ key: itunes-api-{{ checksum "Gemfile.lock" }}
+ paths:
+ - vendor/bundle
+
+ - run:
+ name: Setup Code Climate test-reporter
+ command: |
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
+ chmod +x ./cc-test-reporter
+
+ # Run the tests
+ - run:
+ name: Run tests
+ command: |
+ ./cc-test-reporter before-build
+ bundle exec rspec
+ ./cc-test-reporter after-build --exit-code $?
+
+ # Enforce better practices
+ - run: bundle exec rubocop
+
+ - store_test_results:
+ path: coverage