From 358e704a3348df19a1e2c4ba8291cd4501faf48d Mon Sep 17 00:00:00 2001
From: Philipp Arras <parras@mpa-garching.mpg.de>
Date: Mon, 15 Jul 2019 12:28:54 +0200
Subject: [PATCH] Add ci

---
 .gitlab-ci.yml | 27 +++++++++++++++++++++++++++
 Dockerfile     | 16 ++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 Dockerfile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6d2bc49
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,27 @@
+image: $CONTAINER_TEST_IMAGE
+
+variables:
+  CONTAINER_TEST_IMAGE: gitlab-registry.mpcdf.mpg.de/$CI_PROJECT_PATH:$CI_BUILD_REF_NAME
+  OMP_NUM_THREADS: 1
+  GIT_SUBMODULE_STRATEGY: recursive
+
+stages:
+  - build_docker
+  - test
+
+build_docker:
+  image: docker:stable
+  stage: build_docker
+  script:
+    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
+    - docker build -t $CONTAINER_TEST_IMAGE .
+    - docker push $CONTAINER_TEST_IMAGE
+
+tests:
+  stage: test
+  script:
+    - cd nifty && python3 setup.py install --user -f && cd ..
+    - for file in *.py; do python3 $file; done
+  artifacts:
+    paths:
+      - '*.png'
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..c0f61fa
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,16 @@
+FROM debian:testing-slim
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update && apt-get install -y \
+    # Needed for setup
+    git python3-pip \
+    # Packages needed for NIFTy
+    python3-scipy \
+    # Optional NIFTy dependencies
+    python3-matplotlib \
+  && pip3 install git+https://gitlab.mpcdf.mpg.de/mtr/pypocketfft.git \
+  && rm -rf /var/lib/apt/lists/*
+
+# Set matplotlib backend
+ENV MPLBACKEND agg
\ No newline at end of file
-- 
GitLab