stages:
    - build
    - doc
    - test

# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
    
cache:
  paths:
    - .cache/pip
    - venv/

before_script:
     - echo "deb http://ftp.debian.org/debian jessie main" > /etc/apt/sources.list
     - echo "deb http://ftp.debian.org/debian testing main" >> /etc/apt/sources.list
     - echo 'APT::Default-Release "jessie";' >> /etc/apt/apt.conf.d/00local
     - apt-get -qq update
     - apt-cache policy python3
     - apt-get remove -y binutils
     - apt-get -t testing install -y python3
     - apt-get -qq -t testing install -y python3-venv python3-pip python3-tk
     - python3 -V
     - python3 -m venv venv
     - . venv/bin/activate
     - pip3 install -r requirements.txt
    
    
pages:
    script:
        - echo "Documentation"
        - pip3 install sphinx_rtd_theme
        - sphinx-apidoc -o docs/source .
        - sphinx-build -b html docs/source docs/build
        - mv docs/build/ public/
        
    artifacts:
        paths:
            - public
    only:
        - master
            
            
job_build:
        
    stage: build 
    script: 
        - echo "build"
        - ./etagement.py

        
job_test:

    stage: test
    script:  
        - echo "test"
        - chmod u+rwx Test_Engineering_tools.py
        - ./Test_Engineering_tools.py