version: 2

jobs:
  build:
    docker:
      - image: circleci/python:3.6.0
      - image: circleci/postgres:9.6.1

    working_directory: ~/zendesk-tickets-machine

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "requirements/local.txt" }}
          - v1-dependencies-

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            . venv/bin/activate
            pip install -r requirements/local.txt

      - save_cache:
          paths:
            - ./venv
          key: v1-dependencies-{{ checksum "requirements/local.txt" }}

      - run:
          name: run static analysis
          command: |
            . venv/bin/activate
            flake8

      - run:
          name: run tests
          command: |
            . venv/bin/activate
            cd zendesk_tickets_machine && python manage.py test

      - store_artifacts:
          path: test-reports
          destination: test-reports

version: 2

jobs:
  build:
    working_directory: ~/zendesk-tickets-machine
    docker:
      - image: circleci/python:3.6.0
      - image: circleci/postgres:9.6.1
        environment:
          POSTGRES_USER: root
          POSTGRES_DB: circle_test
    steps:
      - checkout
      - restore_cache:
          keys:
          - deps1-{{ .Branch }}-{{ checksum "requirements/local.txt" }}
          - deps1-{{ .Branch }}-
      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            . venv/bin/activate
            pip install -r requirements/local.txt
      - save_cache:
          paths:
            - ./venv
          key: deps1-{{ .Branch }}-{{ checksum "requirements/local.txt" }}
      - run:
          name: run static analysis
          command: |
            . venv/bin/activate
            flake8
      - run:
          name: run tests
          command: |
            . venv/bin/activate
            cd zendesk_tickets_machine && python manage.py test
      - store_artifacts:
          path: test-reports
          destination: test-reports

Add Postgres env, change cache key, and adjust spacing :bear:
Add Postgres env, change cache key, and adjust spacing :bear:
