rai200890/python-log-sanitizer

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
  build:
    docker:
      - image: circleci/python:3.7.1
        environment:
          CC_TEST_REPORTER_ID: 183b3f0cc4e8fcd87c0395a30578d3d4211441cbf90f7704ba2dce64fa7774be
    steps:
      - checkout
      - run: 
          name: Install OS dependencies
          command: make setup-os
      - run:
          name: Install Code Climate Test Reporter Tool
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
      - run:
          name: Install package dependencies
          command: make setup
      - run:
          command: |
            ./cc-test-reporter before-build
      - run:
          name: Run unit tests
          command: make test
      - run:
          name: Upload test coverage to Code Climate
          command: |
            ./cc-test-reporter format-coverage coverage.xml -t coverage.py
            ./cc-test-reporter upload-coverage
      - run:
          command: |
            ./cc-test-reporter after-build -t coverage.py
      - run: 
          command: make check
      - store_artifacts:
          destination: htmlcov
          path: htmlcov
  deploy:
    docker:
      - image: circleci/python:3.7.1
    steps:
      - checkout
      - run: 
          name: Install OS dependencies
          command: make setup-os
      - run: 
          name: Install package dependencies
          command: make setup      
      - run:
          name: init .pypirc
          command: |
            echo -e "[pypi]" >> ~/.pypirc 
            echo -e "repository = https://upload.pypi.org/legacy/"
      - run:
          name: Publish Package on Pypi
          command: make release 
workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build:
          filters:
            tags:
              only: /.*/
      - deploy:
          requires:
            - build
          filters:
            tags:
              only: /[0-9]+(\.[0-9]+)*/
            branches:
              ignore: /.*/