version: 2
jobs:
  build:
    docker:
      - image: circleci/python:3.6
    working_directory:  ~/dijitso-test
    steps:
      - checkout
      - run:
          name: Install dependencies  # Install with sudo as tests not run as superuser in circleci/python
          command: |
            sudo apt-get update && sudo apt-get install python3-mpi4py
            sudo pip install flake8 pytest numpy --upgrade
      - run:
          name: Install dijitso
          command: pip install . --user
      - run:
          name: Run flake8 tests
          command: python -m flake8 .
      - run:
          name: Run unit tests
          command: python -m pytest ./test/
