From b5035834c5da4ed2ea946e41fc205a9d65587516 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@fit.cvut.cz>
Date: Fri, 30 Nov 2018 11:51:50 +0100
Subject: [PATCH] CI: OpenSuse and ubuntu compat test. Ubuntu:LTS and OpenSuse
 build on clang (gcc7.3.0 error)

---
 .editorconfig  |  4 ++++
 .gitlab-ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/.editorconfig b/.editorconfig
index 96b0e3b99e..fc7c9a9a87 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,6 +10,10 @@ trim_trailing_whitespace = true
 indent_style = tab
 indent_size = 4
 
+[.gitlab-ci.yml]
+indent_style = space
+indent_size = 2
+
 [*.{py,ini}]
 indent_size = 4
 indent_style = space
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fd825738cb..cf75f943ae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -71,6 +71,33 @@ build:arch:
   before_script:
     - pacman -Syu --noconfirm base-devel cmake make python cppunit libxml2 tclap readline qt5-base graphviz jsoncpp
 
+build:opensuse:
+  <<: *build-compatibility
+  image: opensuse/leap:latest
+  before_script:
+    - zypper -n install python3 cmake gcc-c++ curl bash make libxml2-devel cppunit-devel tclap readline-devel libQt5Widgets-devel libQt5Xml-devel graphviz-devel jsoncpp-devel
+    # gcc 7.3.0 fails with StringTest.h (in variant, it thinks something is uninitialized)
+    - zypper -n install clang5
+    - export CXX=clang++-5.0
+
+build:ubuntu:lts:
+  <<: *build-compatibility
+  image: ubuntu:latest
+  before_script:
+    - apt-get update
+    - apt-get install -y build-essential cmake make python3 libcppunit-dev libxml2-dev libtclap-dev libreadline-dev qtbase5-dev graphviz-dev libjsoncpp-dev
+    # gcc 7.3.0 fails with StringTest.h (in variant, it thinks something is uninitialized)
+    - apt-get install -y clang-5.0
+    - export CXX=clang++-5.0
+    - export CXXFLAGS=-stdlib=libstdc++
+
+build:ubuntu:rolling:
+  <<: *build-compatibility
+  image: ubuntu:rolling
+  before_script:
+    - apt-get update
+    - apt-get install -y build-essential cmake make python3 libcppunit-dev libxml2-dev libtclap-dev libreadline-dev qtbase5-dev graphviz-dev libjsoncpp-dev
+
 build:doc:
   stage: build
   before_script:
@@ -147,6 +174,32 @@ test:arch:
   dependencies:
     - build:arch
 
+test:opensuse:
+  <<: *test-compatibility
+  image: opensuse/leap:latest
+  before_script:
+    - zypper -n install bash bc coreutils python3 cmake make libcppunit-1_14-0 libxml2 readline libQt5Widgets5 libQt5Xml5 graphviz libjsoncpp19
+  dependencies:
+    - build:opensuse
+
+test:ubuntu:lts:
+  <<: *test-compatibility
+  image: ubuntu:latest
+  before_script:
+    - apt-get update
+    - apt-get install -y build-essential bash bc coreutils cmake make python3 libcppunit-1.14-0 libxml2 libreadline7 libqt5widgets5 libqt5xml5 graphviz libjsoncpp1
+  dependencies:
+    - build:ubuntu:lts
+
+test:ubuntu:rolling:
+  <<: *test-compatibility
+  image: ubuntu:rolling
+  before_script:
+    - apt-get update
+    - apt-get install -y build-essential bash bc coreutils cmake make python3 libcppunit-1.14-0 libxml2 libreadline7 libqt5widgets5 libqt5xml5 graphviz libjsoncpp1
+  dependencies:
+    - build:ubuntu:rolling
+
 #==========  Stage release =========
 
 .docker: &docker_template
-- 
GitLab