diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5e4b26449fbbe4f767dbe9c395c3f7677c91e2d4..b8b5a5431711bbe9c23798d382382633ecb8cceb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,8 +20,11 @@ variables:
   allow_failure: true
   timeout: 30 minutes
   before_script:
-    - brew install nlohmann-json
+    - brew install nlohmann-json xerces-c
     - export PATH="/usr/local/opt/qt/bin:$PATH" # to make Qt5 discoverable by CMake
+  after_script:
+    - brew remove nlohmann-json xerces-c
+    
 
 .ubuntu-template-job-base: &ubuntu-job-base
   image: ubuntu:18.04