Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.06 KiB
# 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
  - export SITE_PACKAGES=`pwd`/site_packages && mkdir -pv $SITE_PACKAGES
  - export PYTHONPATH=$PYTHONPATH:$SITE_PACKAGES
  - 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.6 python3.6-dev python3-pip
  - pip3 install --target=$SITE_PACKAGES scipy matplotlib nose coverage

# Main build 
build: 
  stage: build
  tags:
    - docker
  script:
    - pip3 install --target=$SITE_PACKAGES -e .

# Tests 
test:
  stage: test
  tags:
    - docker
  dependencies:
    - build
  script:
    - nosetests
  artifacts:
    paths:
      # Tests report
      - build/nosetests.xml
      # Tests coverage report
      - build/htmlcov/
    expire_in: 8d