mobolic/facebook-sdk

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
workflows:
  version: 2
  build:
    jobs:
      - test-python-3.5
      - test-python-3.6
      - test-python-3.7
      - test-python-3.8
jobs:
  test-python-3.5:  &test-python-template
    docker:
      - image: circleci/python:3.5-browsers
    working_directory: ~/facebook-sdk
    steps:
      - checkout
      - run:
          name: install virtualenv and dependencies
          command: |
            mkdir -p ~/venv
            python -m venv ~/venv;
            . ~/venv/bin/activate
            pip install coverage pygments
            pip install -e .
      - run:
          name: run linting
          command: |
            . ~/venv/bin/activate
            if [ $(python -c "import platform; print(platform.python_version()[:3])") == "3.8" ]; then
              pip install black doc8;
              black -l 79 --check examples;
              black -l 79 --check facebook;
              black -l 79 --check test;
              doc8 -q *.rst docs/*.rst;
            fi;
      - run:
          name: download CodeClimate test reporter utility
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
      - run:
          name: run automated tests
          command: |
            . ~/venv/bin/activate
            ./cc-test-reporter before-build
            coverage run --source="facebook" -m unittest discover
            coverage xml
            ./cc-test-reporter format-coverage -t coverage.py -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
      - store_artifacts:
          path: test-reports
          destination: test-reports
      - deploy:
          name: upload test coverage reports to CodeClimate
          command: |
            ./cc-test-reporter sum-coverage -o - -p $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug -i -
  test-python-3.6:
    <<: *test-python-template
    docker:
      - image: circleci/python:3.6-browsers
  test-python-3.7:
    <<: *test-python-template
    docker:
      - image: circleci/python:3.7-browsers
  test-python-3.8:
    <<: *test-python-template
    docker:
      - image: circleci/python:3.8-browsers