presidentbeef/brakeman

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2.1
jobs:
  default: &default
    docker:
      - image: cimg/ruby:3.0
    steps:
      - checkout
      - run: ruby --version && bundle check || bundle install
      - run:
          command: bundle exec rake
      - store_test_results:
          path: test-results
  test-3-1:
    <<: *default
    docker:
      - image: cimg/ruby:3.1
    steps:
      - checkout
      - attach_workspace:
          at: ~/repo/tmp
      - run:
          name:  Download cc-test-reporter
          command: |
            mkdir -p tmp/
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
            chmod +x ./tmp/cc-test-reporter
      - run: bundle check || bundle install
      - run:
          command: |
            bundle exec rake
            ./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.json coverage/.resultset.json
      - store_test_results:
          path: test-results
      - persist_to_workspace:
          root: tmp
          paths:
            - codeclimate.json
            - cc-test-reporter
  test-3-2:
    <<: *default
    docker:
      - image: cimg/ruby:3.2
  test-3-3:
    <<: *default
    docker:
      - image: cimg/ruby:3.3
  upload-coverage:
    <<: *default
    working_directory: ~/repo
    steps:
      - attach_workspace:
          at: ~/repo/tmp
      - run:
          name: Upload coverage results to Code Climate
          command: "./tmp/cc-test-reporter upload-coverage -i ./tmp/codeclimate.json"
workflows:
  version: 2
  tests:
    jobs:
      - default
      - test-3-1
      - test-3-2
      - test-3-3
      - upload-coverage:
          requires:
            - test-3-1