diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2c7d030afff459bc118def46b8e5c3c117ac9dd7..216260de9eb34cb911acaeda9929a4173b5d6022 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,8 +18,7 @@ workflow:
 variables:
   TERM: ansi
 
-# ------------------------------------------------------------------------------
-.parallel_job:
+.parallel_definition:
   image: registry.c4science.ch/scitas-stack/rhel:9.3
   parallel:
     matrix:
@@ -35,6 +34,12 @@ variables:
   tags:
     - ${environment}
     - stack
+
+# ------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------
+.parallel_job:
+  extends:
+    - .parallel_definition
   variables:
     COMMAND_OPTIONS_SBATCH: ${slurm_options}
     STACK_CONFIG: ${CI_PROJECT_DIR}/stacks/${stack}/config.json
@@ -55,15 +60,27 @@ variables:
       - stacks/${stack}/compiler_definitions.yaml
 
 # ------------------------------------------------------------------------------
-spack:setup:
+# ------------------------------------------------------------------------------
+spack:checkout:
   stage: environment
   extends:
     - .spack_cache
-    - .parallel_job
+    - .parallel_definition
   before_script:
     - git config --global --add --bool advice.detachedHead false
+  script:
+    - ls
+  timeout: 1h
+
+spack:setup:
+  stage: environment
+  extends:
+    - .spack_cache
+    - .parallel_job
   script:
     - ci/setup_spack.sh
+  needs:
+    - job: spack:checkout
 
 spack:install_compilers:
   stage: compilers
@@ -80,7 +97,6 @@ spack:install_compilers:
   artifacts:
     reports:
       junit: spack-install.xml
-
   needs:
     - job: spack:setup
   timeout: 5h