From 9b074cf86b8767d984c19476bc97b5f81661841d Mon Sep 17 00:00:00 2001
From: Dimitris Lampridis <dimitris.lampridis@cern.ch>
Date: Tue, 22 Oct 2019 18:34:37 +0200
Subject: [PATCH] add Ubuntu 18.04 to CI

---
 .gitlab-ci.yml             | 20 ++++++++++++++++++--
 scripts/check_dependencies |  5 +++--
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b417109..b99e514 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,14 +1,30 @@
+Ubuntu 18.04 LTS:
+  image: ubuntu:18.04
+  script:
+    - export KVERSION="5.0.0-31-generic"
+    - >
+      apt-get update && apt-get --no-install-recommends -qy install
+      ca-certificates sudo git build-essential
+      linux-image-$KVERSION linux-modules-extra-$KVERSION linux-headers-$KVERSION python
+      python-setuptools python-yaml python-decorator
+      lua5.1 curl libreadline-dev
+    - export LINUX=/lib/modules/$KVERSION/build
+    - export BUILD_DIR=$(mktemp -d)
+    - echo "Building under $BUILD_DIR"
+    - cd scripts
+    - for script in *.sh; do bash $script; done
+
 Debian Buster:
   image: debian:buster
   script:
     - export KVERSION="4.19.0-6-amd64"
-    - export LINUX=/lib/modules/$KVERSION/build
     - >
       apt-get update && apt-get --no-install-recommends -qy install
       ca-certificates sudo git build-essential
       linux-image-$KVERSION linux-headers-$KVERSION python
       python-setuptools python-yaml python-decorator
       lua5.1 curl libreadline-dev
+    - export LINUX=/lib/modules/$KVERSION/build
     - export BUILD_DIR=$(mktemp -d)
     - echo "Building under $BUILD_DIR"
     - cd scripts
@@ -18,7 +34,6 @@ CentOS 7:
   image: centos:7
   script:
     - export KVERSION="3.10.0-1062.4.1.el7.centos.plus.x86_64"
-    - export LINUX=/lib/modules/$KVERSION/build
     - sed -i 's/plugins=.*/plugins=1/' /etc/yum.conf
     - sed -i '/gpgcheck=1/ a priority=1' /etc/yum.repos.d/CentOS-Base.repo
     - sed -i '/^[centosplus]/,/^$/ {s/enabled=.*$/enabled=1/}' /etc/yum.repos.d/CentOS-Base.repo
@@ -28,6 +43,7 @@ CentOS 7:
       kernel-plus kernel-plus-devel kernel-plus-headers
       git sudo gcc make readline-devel patch
       python-setuptools python-yaml python-decorator
+    - export LINUX=/lib/modules/$KVERSION/build
     - export BUILD_DIR=$(mktemp -d)
     - echo "Building under $BUILD_DIR"
     - cd scripts
diff --git a/scripts/check_dependencies b/scripts/check_dependencies
index 22e99a7..3a88f12 100644
--- a/scripts/check_dependencies
+++ b/scripts/check_dependencies
@@ -68,8 +68,9 @@ fi
 sudo -E sh -c 'modinfo -k $KVERSION i2c-mux' 2>/dev/null 1>/dev/null
 if [ $? != 0 ]; then
     echo 'ERROR: i2c-mux module not available in running kernel.'
-    echo '  If using CentOS7 please install the "kernel-plus" package from the CentOSPlus repository.'
-    echo '  For more info: https://wiki.centos.org/AdditionalResources/Repositories/CentOSPlus'
+    echo '  - If using CentOS7 please install the "kernel-plus" package from the CentOSPlus repository.'
+    echo '    For more info: https://wiki.centos.org/AdditionalResources/Repositories/CentOSPlus'
+    echo '  - If using Ubuntu please install the "linux-modules-extra" package corresponding to your kernel.'
     DEP_FAIL=1
 fi
 
-- 
GitLab