From 3606a1be0f71da8f07dc5391a47106bf55f45ae9 Mon Sep 17 00:00:00 2001
From: Denis Arrivault <denis.arrivault@lif.univ-mrs.fr>
Date: Wed, 26 Apr 2017 13:51:13 +0200
Subject: [PATCH] Adding gitlab-ci configuration file

---
 .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 setup.cfg      |  7 +++++--
 2 files changed, 55 insertions(+), 2 deletions(-)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..046a8f6
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,50 @@
+# 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
\ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
index 9af616e..f7fb1ae 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,13 @@
 [nosetests]
 #verbosity=1
 where=./ltfatpy
+with-xunit=1
+xunit-file=./build/nosetests.xml
 with-coverage=1
 cover-package=ltfatpy
 cover-erase=1
 cover-html=1
-cover-html-dir=../htmlcov
+cover-html-dir=../build/htmlcov
 
 [pytest]
 # Specifies a minimal pytest version required for running tests.
@@ -19,4 +21,5 @@ norecursedirs = .git bin build cmake-modules ltfat_C_kernel sandboxes .settings
 source=./ltfatpy
 omit = ./ltfatpy/tests/*
 [coverage html]
-directory=../htmlcov
\ No newline at end of file
+directory=../build/htmlcov
+
-- 
GitLab