image: python:3.5

cache:
  paths:
    - /root/.cache

before_script:
  - pip install tox

flake8:
  script:
    - tox -e flake8

pylint:
  script:
    - tox -e pylint

py27:
  image: python:2.7
  script:
    - tox -e py27
  coverage: '/\S+\.py\s+(?:\d+\s+){4}(\d+\%)/'

py35:
  script:
    - tox -e py35
  coverage: '/\S+\.py\s+(?:\d+\s+){4}(\d+\%)/'

image: python:3.5

cache:
  paths:
    - .pip
    - .tox

before_script:
  - pip --cache-dir=.pip install tox

flake8:
  script:
    - tox -e flake8

pylint:
  script:
    - tox -e pylint

py27:
  image: python:2.7
  script:
    - tox -e py27
  coverage: '/\S+\.py\s+(?:\d+\s+){4}(\d+\%)/'

py35:
  script:
    - tox -e py35
  coverage: '/\S+\.py\s+(?:\d+\s+){4}(\d+\%)/'

Fix caching in GitLab CI configuration
project: Fix caching in GitLab CI configuration

According to the GitLab documentation, only paths within the project
workspace can be cached.

Reference: https://docs.gitlab.com/ce/ci/yaml/#cache
