curationexperts/schoolie

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2.1
jobs:
  build:
    environment:
      COVERAGE: yes
    docker:
      - image: ruby:2.7.4
    steps:
      - checkout
      - run:
          name: Install 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
              ./cc-test-reporter before-build
      - run:
          name: Run rubocop
          command: |
            gem install bundler -v 2.2.33
            bundle install
            bundle exec rake rubocop
      - run:
          name: Run the test task
          command: |
            bundle exec rake test

      - deploy:
          command: curl -k https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN} -d "payload[build_num]=${CIRCLE_WORKFLOW_ID}&payload[status]=done"
  coverage:
    docker:
        - image: circleci/ruby:2.7.4
    working_directory: ~/project
    parallelism: 1
    steps:
        - attach_workspace:
            at: /tmp/codeclimate

        - run:
            name: Install 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:
            name: Upload Coverage
            command: |
                ./cc-test-reporter sum-coverage --output='/tmp/codeclimate/summed_coverage.json' /tmp/codeclimate/codeclimate.*.json
                ./cc-test-reporter upload-coverage --input='/tmp/codeclimate/summed_coverage.json'