* [r-package] cut CI-time dependency on craigcitro/r-travis (fixes #4348) * Install R * Install R on OSX * Remove gfortran symlink * Specify CRAN repo * added more R dependencies needed for testing * removed heavy R dependencies in CI * fixed bug in env var, removed unnecessary apt installs of R * fix to R installs
This commit is contained in:
parent
f4521bf6aa
commit
edae664afb
@ -72,6 +72,7 @@ addons:
|
||||
- graphviz
|
||||
- openssl
|
||||
- libgit2
|
||||
- r
|
||||
update: true
|
||||
|
||||
before_install:
|
||||
|
||||
@ -79,23 +79,50 @@ fi
|
||||
|
||||
if [ ${TASK} == "r_test" ]; then
|
||||
set -e
|
||||
export _R_CHECK_TIMINGS_=0
|
||||
export R_BUILD_ARGS="--no-build-vignettes --no-manual"
|
||||
export R_CHECK_ARGS="--no-vignettes --no-manual"
|
||||
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
|
||||
# Work-around to fix "gfortran command not found" error
|
||||
sudo ln -s $(which gfortran-7) /usr/local/bin/gfortran
|
||||
sudo mkdir -p /usr/local/gfortran/lib/gcc/x86_64-apple-darwin15
|
||||
sudo ln -s /usr/local/lib/gcc/7 /usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0
|
||||
fi
|
||||
|
||||
curl -OL https://raw.githubusercontent.com/craigcitro/r-travis/master/scripts/travis-tool.sh
|
||||
chmod 755 ./travis-tool.sh
|
||||
./travis-tool.sh bootstrap
|
||||
make Rpack
|
||||
cd ./xgboost
|
||||
../travis-tool.sh install_deps
|
||||
../travis-tool.sh run_tests
|
||||
|
||||
# Install package deps
|
||||
Rscript -e "install.packages( \
|
||||
c('devtools', 'testthat', 'lintr') \
|
||||
, repos = 'http://cloud.r-project.org' \
|
||||
, dependencies = c('Depends', 'Imports', 'LinkingTo') \
|
||||
)"
|
||||
|
||||
Rscript -e \
|
||||
"devtools::install_deps( \
|
||||
repos = 'http://cloud.r-project.org' \
|
||||
, upgrade = 'never' \
|
||||
, dependencies = c('Depends', 'Imports', 'LinkingTo') \
|
||||
)"
|
||||
|
||||
# install suggested packages separately to avoid huge build times
|
||||
Rscript -e "install.packages( \
|
||||
c('DiagrammeR', 'Ckmeans.1d.dp', 'vcd') \
|
||||
, repos = 'https://cloud.r-project.org' \
|
||||
, dependencies = c('Depends', 'Imports', 'LinkingTo') \
|
||||
)"
|
||||
|
||||
# Run tests
|
||||
echo "Building with R CMD build"
|
||||
R CMD build \
|
||||
--no-build-vignettes \
|
||||
--no-manual \
|
||||
.
|
||||
|
||||
echo "Running R tests"
|
||||
R_PACKAGE_TARBALL=$(ls -1t *.tar.gz | head -n 1)
|
||||
|
||||
export _R_CHECK_TIMINGS_=0
|
||||
export _R_CHECK_FORCE_SUGGESTS_=false
|
||||
R CMD check \
|
||||
${R_PACKAGE_TARBALL} \
|
||||
--no-vignettes \
|
||||
--no-manual \
|
||||
--as-cran \
|
||||
--install-args=--build
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user