.circleci/config.yml
version: 2.1
orbs:
ruby: circleci/ruby@1.1.1
jobs:
build:
docker:
- image: circleci/ruby:2.6-node-browsers
- image: docker.elastic.co/elasticsearch/elasticsearch:7.9.0
environment:
- "discovery.type=single-node"
- "xpack.security.enabled=false"
- "http.host=0.0.0.0"
- "transport.host=127.0.0.1"
working_directory: ~/repo
steps:
- checkout
- run:
name: Waiting for elasticsearch to start up (30 sec.)
command: sleep 30
- run:
name: Install dependencies
command: bundle install --jobs=4 --retry=3 --path vendor/bundle
- run:
name: Install CodeClimate test coverage reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- run:
name: Run tests
command: |
mkdir /tmp/test-results
bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
- run:
name: Upload test coverage report to CodeClimate
command: ./cc-test-reporter after-build --exit-code $?