diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2077709b6e87049f8bbad97da759d53988ea5588..e55c5154db6f071a359e9b4cd345a32d0694812f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,25 +21,37 @@
   - apt-get update
 
 .install_wolf_template: &install_wolf_definition
-  - git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
-  - cd wolf
+  - if [ -d wolf ]; then
+  -   echo "directory wolf exists"
+  -   cd wolf
+  -   git pull
+  - else
+  -   git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
+  -   cd wolf
+  - fi
   - mkdir -pv build
   - cd build
   - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
-  - make -j$(nproc)
-  - ctest -j$(nproc)
+  - make 
+  - ctest 
   - make install
   - cd ../..
 
 .install_gnssutils_template: &install_gnssutils_definition
-  - git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/gauss_project/gnss_utils.git
-  - cd gnss_utils
-  - git submodule update --init
+  - if [ -d gnss_utils ]; then
+  -   echo "directory gnss_utils exists"
+  -   cd gnss_utils
+  -   git pull
+  - else
+  -   git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/gauss_project/gnss_utils.git
+  -   cd gnss_utils
+  -   git submodule update --init
+  - fi
   - mkdir -pv build
   - cd build
   - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
-  - make -j$(nproc)
-  - ctest -j$(nproc)
+  - make -j2
+  - ctest -j2
   - make install
   - cd ../..
 
@@ -47,13 +59,20 @@
   - mkdir -pv build
   - cd build
   - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
-  - make -j$(nproc)
-  - ctest -j$(nproc)
+  - make -j2
+  - ctest -j2
   - make install
 
 ############ UBUNTU 16.04 TESTS ############
 wolf_build_and_test_none:xenial:
   image: labrobotica/wolf_deps:16.04
+  cache:
+    - key: wolf-xenial
+      paths:
+      - wolf/
+    - key: gnssutils-xenial
+      paths:
+      - gnss_utils/
   except:
     - master
   before_script:
@@ -67,6 +86,13 @@ wolf_build_and_test_none:xenial:
 ############ UBUNTU 18.04 TESTS ############
 wolf_build_and_test_none:bionic:
   image: labrobotica/wolf_deps:18.04
+  cache:
+    - key: wolf-bionic
+      paths:
+      - wolf/
+    - key: gnssutils-bionic
+      paths:
+      - gnss_utils/
   except:
     - master
   before_script: