From e6aa7d7ec08122956e4a28085e16d8b99ff107a2 Mon Sep 17 00:00:00 2001
From: Dorchies David <david.dorchies@irstea.fr>
Date: Thu, 17 Mar 2022 12:22:37 +0100
Subject: [PATCH] ci: add cran check and tests

error_on = "error " because of #10
---
 .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..cdd2e73
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,31 @@
+stages:
+  - check
+
+variables:
+  R_CI: "$CI_PROJECT_DIR/ci"
+  R_LIBS_USER: "$R_CI/lib"
+
+default:
+  tags: [docker]
+  image: rocker/verse:devel
+
+cache:
+  paths:
+    - $R_CI
+
+before_script:
+  - mkdir -p $R_LIBS_USER
+  - echo "R_LIBS='$R_LIBS_USER'" > .Renviron
+  - R -q -e 'remotes::install_deps(dependencies = TRUE)'
+
+check:
+  stage: check
+  script:
+  - tlmgr update --self && tlmgr install ec epstopdf-pkg
+  - R -q -e 'remotes::update_packages("rcmdcheck")'
+  - R -q -e 'rcmdcheck::rcmdcheck(args = "--as-cran", error_on = "error")'
+
+test_all:
+  stage: check
+  script:
+  - R -q -e 'devtools::test()'
-- 
GitLab