# CI Config for ltaftpy / gitlab
stages:
  - build
  - test

# Global runner/docker image definition
image: ubuntu:latest

# Global caching 
cache:
  key: "cache"
  paths:
# apt
    - apt-cache
# build
    - build
  
before_script:
  - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
  - apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake libfftw3-dev
  - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y liblapack-dev python3.5 python3.5-dev python3-pip
  - pip3 install --upgrade pip
  - pip3 install scipy matplotlib nose coverage cython

# Main build 
build: 
  stage: build
  tags:
    - docker
  script:
    - pip3 install -e .

# Tests 
test:
  stage: test
  tags:
    - docker
  dependencies:
    - build
  script:
    - nosetests
  artifacts:
    when: always
    untracked: true
    paths:
      - build/
    expire_in: 8d