-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtoxEval.gitlab-ci.yml
More file actions
64 lines (56 loc) · 1.88 KB
/
toxEval.gitlab-ci.yml
File metadata and controls
64 lines (56 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
image: rocker/tidyverse
stages:
- check
- test
variables:
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_SUGGESTS_ONLY: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
APT_PKGS: "libgeos-dev"
APT_CACHE: "$CI_PROJECT_DIR/ci/lib/apt-cache"
CRAN_MIRROR: "https://cloud.r-project.org"
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
R_LIBS: "$CI_PROJECT_DIR/ci/lib"
BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs"
before_script:
- mkdir -p $APT_CACHE
- apt-get update
- apt-get -o dir::cache::archives=${APT_CACHE} install -y --no-install-recommends ${APT_PKGS}
getready:
stage: .pre
script:
- mkdir -p $R_LIBS_USER
- R -e 'install.packages(c("lintr", "DT", "leaflet", "shiny", "shinydashboard", "RColorBrewer", "shinyAce", "shinycssloaders", "here", "tcpl", "openxlsx"), repos = Sys.getenv("CRAN_MIRROR"), lib = Sys.getenv("R_LIBS_USER"))'
- R -e 'withr::with_libpaths(new = Sys.getenv("R_LIBS_USER"), remotes::install_github("USGS-R/wateRuse", repos = Sys.getenv("CRAN_MIRROR")))'
artifacts:
paths:
- $R_LIBS_USER
buildcheck:
stage: check
script:
- mkdir -p $BUILD_LOGS_DIR
- apt-get -o dir::cache::archives=${APT_CACHE} install -y --no-install-recommends qpdf pandoc pandoc-citeproc
- R CMD build . --no-build-vignettes --no-manual
- R -e 'devtools::check(document = FALSE, args = "--no-tests", error_on = "error", check_dir = Sys.getenv("BUILD_LOGS_DIR"))'
- R -e 'lintr::lint_package()'
artifacts:
paths:
- $BUILD_LOGS_DIR
unittests:
stage: test
dependencies:
- getready
- buildcheck
script:
- R -e 'if (any(as.data.frame(devtools::test())[["failed"]] > 0)) stop("Some tests failed.")'
covertests:
stage: test
dependencies:
- getready
- buildcheck
script:
- R -e 'x <- covr::package_coverage();x;saveRDS(x, file = "cover.rds")'
artifacts:
paths:
- cover.rds
coverage: '/Coverage: \d+.\d+\%/'