Skip to content

Commit

Permalink
simplify ci scripts: remotes supports submodules since v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dschlaep committed Aug 12, 2020
1 parent e5f31d4 commit bfaca26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
22 changes: 8 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ addons:
- netcdf-bin

before_install:
# pwd = <repo>/<repo-name>, here DrylandEcology/rSFSW2
# Download rSW2utils from github (as dependency of rSOILWAT2)
- git clone -b master --single-branch --recursive https://github.com/DrylandEcology/rSW2utils.git ../rSW2utils
# Download rSOILWAT2 from github (as dependency of rSFSW2)
- git clone -b master --single-branch --recursive https://github.com/DrylandEcology/rSOILWAT2.git ../rSOILWAT2
# Download rSW2funs from github (as dependency of rSFSW2)
- git clone -b master --single-branch --recursive https://github.com/DrylandEcology/rSW2funs.git ../rSW2funs
# Use git-lfs to pull reference files for rSFSW2 package checking
- git lfs pull

Expand All @@ -56,14 +49,15 @@ install:
- 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 from github (as dependency of rSOILWAT2)
- R CMD INSTALL --no-docs --no-help ../rSW2utils
# Install rSOILWAT2 from github (as dependency of rSFSW2)
- R CMD INSTALL --no-docs --no-help ../rSOILWAT2
# Install rSW2funs from github (as dependency of rSFSW2)
- R CMD INSTALL --no-docs --no-help ../rSW2funs
# Install rSW2utils as dependency of rSOILWAT2 and rSFSW2
- Rscript -e 'remotes::install_github("DrylandEcology/rSW2utils", upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
# Install rSOILWAT2 as dependency of rSFSW2
# `remotes::install_github` supports submodules since v2.0.0!
- Rscript -e 'remotes::install_github("DrylandEcology/rSOILWAT2", upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
# Install rSW2funs as dependency of rSFSW2
- Rscript -e 'remotes::install_github("DrylandEcology/rSW2funs", upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
# Install rSFSW2 dependencies, but remove `Rmpi` etc.
- Rscript -e 'pkgs <- remotes::dev_package_deps(dependencies = TRUE); ids_not <- pkgs[, "package"] %in% c("rSW2utils", "rSOILWAT2", "Rmpi", "weathergen", "lubridate", "zoo", "dplyr"); update(pkgs[!ids_not, ], upgrade = TRUE, lib = Sys.getenv("R_LIBS_USER"))'
- 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 .
Expand Down
7 changes: 2 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ cache:
build_script:
- travis-tool.sh install_r blob DBI RSQLite circular mvtnorm
- travis-tool.sh install_github DrylandEcology/rSW2utils
# we cannot use `remotes::install_github` to install `rSOILWAT2`
# because submodules are not supported by the `remotes` package
- cmd: >-
git clone -b master --single-branch --recurse-submodules --recursive https://github.com/DrylandEcology/rSOILWAT2.git /tmp/rSOILWAT2
&& R CMD INSTALL C:/tmp/rSOILWAT2
# `remotes::install_github` supports submodules since v2.0.0!
- travis-tool.sh install_github DrylandEcology/rSOILWAT2
- travis-tool.sh install_github DrylandEcology/rSW2funs
- travis-tool.sh install_deps

Expand Down

0 comments on commit bfaca26

Please sign in to comment.