diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5f8de3d4e4dbc2f1e67f259cd41811ac06a2e297..8b00ab32cbaf61672e583d57f87e300de23a8bf0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,8 @@ stages:
   stage: build
   image: coqorg/${CI_JOB_NAME}
   before_script:
-    - if [ -n "${COMPILER_EDGE}" ]; then opam switch ${COMPILER_EDGE} && eval $(opam env); fi
+    - if [ -n "${COMPILER_EDGE}" ]; then opam switch ${COMPILER_EDGE}; fi
+    - eval $(opam env)
     - opam update -y
     - opam config list
     - opam repo list