From 2169d410ddff0c5bce82fa4e621c979fddc8239c Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Wed, 25 Mar 2020 00:27:06 +0200 Subject: [PATCH] Test code climate --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 421d28b..94b2462 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,8 @@ references: jobs: build: + environment: + CC_TEST_REPORTER_ID: b3db5b7df9a0a1d0fd3503e72d7431ffbfa172492c2840d590ccb2fafd9172d3 docker: - *default_docker_ruby_executor steps: @@ -45,6 +47,17 @@ jobs: key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }} paths: - vendor/bundle + - run: + name: Setup dependencies + command: | + sudo composer self-update + composer install -n --prefer-dist + # download test reporter as a static binary + - 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 # Only necessary if app uses webpacker or yarn in some other way #- restore_cache: # keys: @@ -92,8 +105,10 @@ jobs: - run: command: | mkdir /tmp/test-results + ./cc-test-reporter before-build TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) bundle exec rspec $TESTFILES --profile 10 -r rspec_junit_formatter --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress + ./cc-test-reporter after-build --coverage-input-type clover --exit-code $? - store_test_results: path: /tmp/test-results - store_artifacts: