diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 56a767b7171d83fec86fca5cd9252229c76c914f..2018d40604e743bba780509b9cbee80a12938c86 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,3 +6,27 @@ include:
   - project: 'biosignal/templates/ci'
     ref: main
     file: 'python.yml'
+
+variables:
+  OMP_NUM_THREADS: 1  # for pytorch CI tests on docker platform
+  GIT_SUBMODULE_STRATEGY: normal
+  GIT_SUBMODULE_DEPTH: 1
+
+.snippets:
+  apt-install-libgl:
+      # apt install libgl1-mesa-glx for grad-cam
+      - |
+        if [[ ${CI_RUNNER_TAGS} =~ '"docker"' ]]; then \
+          apt update; \
+          apt install -y libgl1-mesa-glx > /dev/null; \
+        fi
+
+tests:
+  before_script:
+    - !reference [.snippets, setup-pixi]
+    - !reference [.snippets, apt-install-libgl]
+
+documentation:
+  before_script:
+    - !reference [.snippets, setup-pixi]
+    - !reference [.snippets, apt-install-libgl]