-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
77 lines (67 loc) · 4.08 KB
/
.travis.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
language: r
os: linux
# Set environmental variables
# - _R_CHECK_FORCE_SUGGESTS_=false: don't fail if suggested packages fail
# to install: for us, Rmpi, ncdf4, hydromat, and weathergen
# - I attempted to set `NOT_CRAN` to false to match `as-cran` option of
# checks; however, this currently appears to have no bearing for the actual
# tests; note, travis default is true
env:
global:
- _R_CHECK_FORCE_SUGGESTS_=false
- NOT_CRAN=false
# secure `GITHUB_PAT` for drs to increase "GitHub API rate limit"
- secure: "rq8iu0qkN0QYa1CF3zx/ub2eXJ1vc6XmOSqWPUSCHQTOuftUnKjbysAo0a8Cj1GqHPltXyIx8ZfLSJpN/zIsW919B3XBPSVeoStdpvJ/omUdGf8g4/0k2jlLQx0JpfFuIjOaFBlL5Kg5iAm3Xg1dxA/+cgx57KLbbF91HEvCE22g5NgO5ZEWsKH6iyVzEkz5o3sxvIxDEniiJSKdxfZLe8jrZNmqG+H2tKn1GbiDfunN8ynYE5Enwamr6y46E8Q2Bm7BR4FX3syxjvhz/JOi44vy88E50wKpMU+y9/lxpqMjQxM8lU0L5ZAxsSe08fM6jvEzOVZgsEVS3tMJHdCy9mQ3YktVl7l4hce4+OI866ZkkfpX2nBoGcjLe9LVbbGLet7UoC8DNv5XF1eJU+9sn5Ynr94YFaNhlFP2H+PoqWgyt7SLpgYjogrd8/X8a/oQeIMhriqNVbddc6oB2rkBsjRA9kGo+8jcHei80Xm/ZaIafMoa9KZV4Aw7Uhd/RP0JiaRQmL8mBf09/LOJD24LIpqYzgHJg6q6pHa/XS+9qcbjoObzbdy1rBtGiS5f1eXrCefTmsvSsOvRWlyZcGLrX2VbTFiLTjFCDWLjYNMUVCxhislsxZCrvRuMaS9IIep8rD+p8EDjUIr/UTq/vl64E1jfd3+3wA4rcW3nbQ6iiYg="
- LINTR_COMMENT_BOT=false
cache: packages # sets `R_LIBS_USER`
warnings_are_errors: false # turn this back on for more severe testing
# Next three settings (latex, r_build_args, and r_check_args -- though, the
# latter two are not used because we use our own 'script' section: see there):
# because unit tests take now too much time due to the extended unit test
# project; some travis runs fail due to taking longer than the allotted 60-min
# maximum; for now omit PDF vignettes and manual until we have proper, fast
# running unit tests
latex: false
r_build_args: '--no-build-vignettes --no-manual'
r_check_args: '--as-cran --ignore-vignettes --no-manual'
addons:
apt:
packages:
- libudunits2-dev
- libproj-dev
- libgeos-dev
- libgdal-dev
- libnetcdf-dev
- netcdf-bin
before_install:
# Use git-lfs to pull reference files for rSFSW2 package checking
- git lfs pull
install:
# Use `remotes` to detect/install/update package dependencies
- Rscript -e 'utils::install.packages("remotes", lib = Sys.getenv("R_LIBS_USER"))'
# Custom install/update dependencies of rSW2utils and rSOILWAT2
- Rscript -e 'remotes::update_packages(c("blob", "DBI", "RSQLite", "circular", "mvtnorm"), upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
# Install rSW2utils as dependency of rSOILWAT2 and rSFSW2
- Rscript -e 'remotes::install_github("DrylandEcology/rSW2utils", upgrade = TRUE)'
# Install rSOILWAT2 as dependency of rSFSW2
# `remotes::install_github` supports submodules since v2.0.0!
- Rscript -e 'remotes::install_github("DrylandEcology/rSOILWAT2", upgrade = TRUE)'
# Install rSW2funs as dependency of rSFSW2
- Rscript -e 'remotes::install_github("DrylandEcology/rSW2funs", upgrade = TRUE)'
# Install rSFSW2 dependencies, but remove `Rmpi` etc.
- Rscript -e 'pkgs <- remotes::dev_package_deps(dependencies = TRUE); ids_not <- pkgs[, "package"] %in% c("rSW2utils", "rSOILWAT2", "rSW2funs", "Rmpi", "weathergen", "lubridate", "zoo", "dplyr"); update(pkgs[!ids_not, ], upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
script:
- R CMD build --no-build-vignettes --no-manual .
# The extended unit test project
# (commit db3948e6aa746d012dbc4f25b0e9bb2a4186305f) takes about 16 min which
# is too long for the default settings of 10-min and times out --> use `travis_wait`
- travis_wait 30 R CMD check *tar.gz --as-cran --ignore-vignettes --no-manual
after_success:
# Display testthat log file for more information if it exists and has content
- fname="rSFSW2.Rcheck/tests/testthat.Rout" && [ -s $fname ] && cat $fname
# Perform code cover estimate
- travis_wait 30 Rscript -e 'covr::codecov()'
after_failure:
# Display failed testthat log file for more information if it exists and has content
- fname="rSFSW2.Rcheck/tests/testthat.Rout.fail" && [ -s $fname ] && cat $fname