Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r-package] cut CI-time dependency on craigcitro/r-travis (fixes #4348) #4353

Merged
merged 9 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ addons:
- graphviz
- openssl
- libgit2
- r
update: true

before_install:
Expand Down
57 changes: 42 additions & 15 deletions tests/travis/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down