From f0c421adb1d4d1944c2e1940773e43069c7a3153 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Wed, 24 Nov 2021 10:32:52 +0100
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 60 ++++++++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 29 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d878e81b2..64b5a0028 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,9 +28,11 @@ stages:
 
   # store folder
   - echo $PWD
-  - export RUNNER_FOLDER=$PWD
+  - echo $CI_PROJECT_DIR
+  - echo $CI_BUILDS_DIR
 
 .build_install_wolf_template: &build_install_wolf_definition
+  - cd $CI_BUILDS_DIR
   - if [ -d wolf ]; then
   -   echo "directory wolf exists"
   -   cd wolf
@@ -47,9 +49,9 @@ stages:
   - make -j$WOLF_N_PROC
   - ctest -j$WOLF_N_PROC
   - make install
-  - cd ../..
 
 .build_install_laserscanutils_template: &build_install_laserscanutils_definition
+  - cd $CI_BUILDS_DIR
   - if [ -d laser_scan_utils ]; then
   -   echo "directory laser_scan_utils exists"
   -   cd laser_scan_utils
@@ -64,9 +66,9 @@ stages:
   - cmake -DCMAKE_BUILD_TYPE=release ..
   - make -j$WOLF_N_PROC
   - make install
-  - cd ../..
 
 .build_install_csm_template: &build_install_csm_definition
+  - cd $CI_BUILDS_DIR
   - apt-get install -y libgsl-dev
   - if [ -d csm ]; then
   -   echo "directory csm exists"
@@ -79,9 +81,9 @@ stages:
   - cmake .
   - make -j$WOLF_N_PROC
   - make install
-  - cd ..
 
 .build_install_falko_template: &build_install_falko_definition
+  - cd $CI_BUILDS_DIR
   - if [ -d falkolib ]; then
   -   echo "directory falkolib exists" 
   -   cd falkolib
@@ -95,9 +97,9 @@ stages:
   - cmake ..
   - make -j$WOLF_N_PROC
   - make install
-  - cd ../..
 
 .build_and_test_template: &build_and_test_definition
+  - cd $CI_PROJECT_DIR
   - mkdir -pv build
   - cd build
   - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
@@ -112,10 +114,10 @@ build_and_test_none:xenial:
   cache:
     - key: laserscanutils-xenial
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: wolf-xenial
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
   except:
     - master
   before_script:
@@ -132,13 +134,13 @@ build_and_test_csm:xenial:
   cache:
     - key: wolf-xenial
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-xenial
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: csm-xenial
       paths:
-      - csm/
+      - ${CI_BUILDS_DIR}/csm/
   except:
     - master
   before_script:
@@ -157,13 +159,13 @@ build_and_test_falko:xenial:
   cache:
     - key: wolf-xenial
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-xenial
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: falko-xenial
       paths:
-      - falkolib/
+      - ${CI_BUILDS_DIR}/falkolib/
   except:
     - master
   before_script:
@@ -182,16 +184,16 @@ build_and_test_csm_falko:xenial:
   cache:
     - key: wolf-xenial
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-xenial
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: csm-xenial
       paths:
-      - csm/
+      - ${CI_BUILDS_DIR}/csm/
     - key: falko-xenial
       paths:
-      - falkolib/
+      - ${CI_BUILDS_DIR}/falkolib/
   except:
     - master
   before_script:
@@ -212,10 +214,10 @@ build_and_test_none:bionic:
   cache:
     - key: wolf-bionic
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-bionic
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
   except:
     - master
   before_script:
@@ -232,13 +234,13 @@ build_and_test_csm:bionic:
   cache:
     - key: wolf-bionic
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-bionic
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: csm-bionic
       paths:
-      - csm/
+      - ${CI_BUILDS_DIR}/csm/
   except:
     - master
   before_script:
@@ -257,13 +259,13 @@ build_and_test_falko:bionic:
   cache:
     - key: wolf-bionic
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-bionic
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: falko-bionic
       paths:
-      - falkolib/
+      - ${CI_BUILDS_DIR}/falkolib/
   except:
     - master
   before_script:
@@ -282,16 +284,16 @@ build_and_test_csm_falko:bionic:
   cache:
     - key: wolf-bionic
       paths:
-      - wolf/
+      - ${CI_BUILDS_DIR}/wolf/
     - key: laserscanutils-bionic
       paths:
-      - laser_scan_utils/
+      - ${CI_BUILDS_DIR}/laser_scan_utils/
     - key: csm-bionic
       paths:
-      - csm/
+      - ${CI_BUILDS_DIR}/csm/
     - key: falko-bionic
       paths:
-      - falkolib/
+      - ${CI_BUILDS_DIR}/falkolib/
   except:
     - master
   before_script:
-- 
GitLab