diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 62e4060707cfc25e347c3de07c93707e5e9708f0..32425764713b957ef248a0fd7954f900c12b3baa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,9 +6,6 @@ stages:
   - test-jobs
   - test-tasks
 
-before_script:
-  - poetry config virtualenvs.in-project true
-
 cache:
   paths:
     - .venv
@@ -19,6 +16,7 @@ build-env:
   - pip install poetry
   - poetry --version
   - cd build/
+  - poetry config virtualenvs.in-project true
   - poetry install --no-root
 
 format: