CI: install xsltproc in before_script, drop apt-get from after_script

libeigen/eigen!2516

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/ci/scripts/common.linux.before_script.sh b/ci/scripts/common.linux.before_script.sh
index 396ebc0..fd655d4 100755
--- a/ci/scripts/common.linux.before_script.sh
+++ b/ci/scripts/common.linux.before_script.sh
@@ -18,7 +18,7 @@
 # geographical region.
 export DEBIAN_FRONTEND=noninteractive
 apt-get update -y > /dev/null
-apt-get install -y --no-install-recommends ninja-build cmake git > /dev/null
+apt-get install -y --no-install-recommends ninja-build cmake git xsltproc > /dev/null
 
 # Install required dependencies and set up compilers.
 # These are required even for testing to ensure that dynamic runtime libraries
diff --git a/ci/scripts/test.linux.after_script.sh b/ci/scripts/test.linux.after_script.sh
index c626e45..8891a5f 100755
--- a/ci/scripts/test.linux.after_script.sh
+++ b/ci/scripts/test.linux.after_script.sh
@@ -8,11 +8,7 @@
 rootdir=`pwd`
 cd ${EIGEN_CI_BUILDDIR}
 
-# Install xml processor.
-apt-get update -y
-apt-get install --no-install-recommends -y xsltproc
-
-# Generate test results.
+# Generate test results. xsltproc is installed by common.linux.before_script.sh.
 xsltproc ${rootdir}/ci/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > "JUnitTestResults_$CI_JOB_ID.xml"
 
 # Return to root directory.