From 01829f7f4f056c373b8f9261407015cb64d86b01 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Sat, 13 Apr 2019 22:24:13 +0200
Subject: [PATCH] CI: add fast build step

---
 .gitlab-ci.yml             |  9 +++++++++
 CI/ubuntu-18.04-fast.cmake | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 CI/ubuntu-18.04-fast.cmake

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cc1ed42584..2ab3b8a471 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,6 +29,7 @@ after_script:
   - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH
 
 stages:
+  - precheck
   - build
 
 .general:
@@ -38,6 +39,14 @@ stages:
       - runner_system_failure
       - stuck_or_timeout_failure
 
+fast-build:
+  extends: .general
+  only: [merge_requests, branches]
+  stage: precheck
+  image: $CI_REGISTRY/gpasero/otb-install-ubuntu-native
+  script:
+    - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
+
 debian-build:
   extends: .general
   only: [merge_requests]
diff --git a/CI/ubuntu-18.04-fast.cmake b/CI/ubuntu-18.04-fast.cmake
new file mode 100644
index 0000000000..21c2a456c7
--- /dev/null
+++ b/CI/ubuntu-18.04-fast.cmake
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Configuration options for ubuntu-18.04-fast
+
+set(site_option
+"opencv_INCLUDE_DIR:PATH=/usr/include
+CMAKE_C_COMPILER:STRING=clang
+CMAKE_CXX_COMPILER:STRING=clang++
+CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld
+CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld
+CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld
+CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
+CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
+OTB_USE_SHARK:BOOL=OFF
+BUILD_EXAMPLES:BOOL=OFF")
-- 
GitLab