From 92a1f2a95fca6b7524beeda2892c90b0dc2f465e Mon Sep 17 00:00:00 2001
From: Sebastian Henz <sebastian.henz@ufz.de>
Date: Fri, 4 Sep 2020 13:40:59 +0200
Subject: [PATCH] Run all in one session so the env var is set correctly. Fixes
 #54 for real

---
 .gitlab-ci.yml | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d9f6113..aa8e04b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,16 +5,25 @@
 # with "document = TRUE" (the default), which updates the .Rd files, but then
 # forgetting to commit and push those updated .Rd files.
 
+# Setting the environment variable "_R_CHECK_SYSTEM_CLOCK_" to 0
+# to disable package time check, see issue #54
+
+# Run the R commands under a single "R -e" so everything runs in
+# the same R session.
+# Note for the future: If there are going to be more R commands just put them
+# in a separate R script and run that from here.
+
 .check_template: &check_job_template
   only:
     - master
     - merge_requests
     - tags
   script:
-    - R -e 'sessionInfo()'
-    - R -e 'Sys.setenv("_R_CHECK_SYSTEM_CLOCK_" = 0)'  # disable time check, see issue #54
-    - R -e 'devtools::install_deps(quiet = TRUE)'
-    - R -e 'devtools::check(error_on = "note", document = FALSE)'
+    - R -e
+        "sessionInfo();
+        Sys.setenv('_R_CHECK_SYSTEM_CLOCK_' = 0);
+        devtools::install_deps(quiet = TRUE);
+        devtools::check(error_on = 'note', document = FALSE)"
 
 # Earliest supported version
 check-3.5.1:
-- 
GitLab