refactor and ci

This commit is contained in:
tqchen 2015-07-03 21:08:36 -07:00
parent 59b91cf205
commit af0a451dc4
6 changed files with 103 additions and 42 deletions

1
.gitignore vendored
View File

@ -66,3 +66,4 @@ java/xgboost4j-demo/data/
java/xgboost4j-demo/tmp/ java/xgboost4j-demo/tmp/
java/xgboost4j-demo/model/ java/xgboost4j-demo/model/
nb-configuration* nb-configuration*
dmlc-core

View File

@ -1,36 +1,45 @@
language: c
env:
global:
- _R_CHECK_TIMINGS_=0
- R_BUILD_ARGS="--no-build-vignettes --no-manual"
- R_CHECK_ARGS="--no-vignettes --no-manual"
warnings_are_errors: false
sudo: true sudo: true
# Use Build Matrix to do lint and build seperately
env:
matrix:
- TASK=lint LINT_LANG=cpp
- TASK=lint LINT_LANG=python
- TASK="R-package"
- TASK="python-package"
- TASK=build CXX=g++
- TASK=build-with-dmlc CXX=g++
# dependent apt packages
addons:
apt:
packages:
- doxygen
- libopenmpi-dev
- wget
- libcurl4-openssl-dev
- unzip
- python-numpy
- python-nose
before_install: before_install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh - git clone https://github.com/dmlc/dmlc-core
- chmod 755 ./travis-tool.sh - export TRAVIS=dmlc-core/scripts/travis/
- ./travis-tool.sh bootstrap - export PYTHONPATH=${PYTHONPATH}:${PWD}/wrapper
- source ${TRAVIS}/travis_setup_env.sh
install: install:
- make Rpack - pip install cpplint pylint --user `whoami`
- cd ./xgboost
- ../travis-tool.sh install_deps
script: script: scripts/travis_script.sh
- bash ../travis-tool.sh run_tests
after_failure: cat /home/travis/build/dmlc/xgboost/R-package/xgboost.Rcheck/00install.out
after_failure:
- scripts/travis_after_failure.sh
notifications: notifications:
email: email:
recipients:
- hetong007@gmail.com
- tqchen@cs.washington.edu
on_success: change on_success: change
on_failure: always on_failure: always

View File

@ -69,7 +69,7 @@ else
TARGET = $(BIN) TARGET = $(BIN)
endif endif
.PHONY: clean all mpi python Rpack .PHONY: clean all mpi python Rpack lint
all: $(TARGET) all: $(TARGET)
mpi: $(MPIBIN) mpi: $(MPIBIN)
@ -157,6 +157,10 @@ Rcheck:
make Rbuild make Rbuild
R CMD check --as-cran xgboost*.tar.gz R CMD check --as-cran xgboost*.tar.gz
# lint requires dmlc to be in current folder
lint:
dmlc-core/scripts/lint.py xgboost $(LINT_LANG) src wrapper R-package
clean: clean:
$(RM) -rf $(OBJ) $(BIN) $(MPIBIN) $(MPIOBJ) $(SLIB) *.o */*.o */*/*.o *~ */*~ */*/*~ $(RM) -rf $(OBJ) $(BIN) $(MPIBIN) $(MPIOBJ) $(SLIB) *.o */*.o */*/*.o *~ */*~ */*/*~
cd subtree/rabit; make clean; cd .. cd subtree/rabit; make clean; cd ..

14
scripts/travis_R_script.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Test R package of xgboost
set -e
export _R_CHECK_TIMINGS_=0
export R_BUILD_ARGS="--no-build-vignettes --no-manual"
export R_CHECK_ARGS="--no-vignettes --no-manual"
curl -OL http://raw.github.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

View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ ${TASK} == "R-package" ]; then
cat R-package/xgboost.Rcheck/00install.out
fi

28
scripts/travis_scripts.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# main script of travis
if [ ${TASK} == "lint" ]; then
make lint || exit -1
fi
if [ ${TASK} == "build" ]; then
make all CXX=${CXX} || exit -1
fi
if [ ${TASK} == "build-with-dmlc" ]; then
cd dmlc-core
cp make/config.mk .
echo "USE_S3=1" >> config.mk
make all CXX=${CXX}|| exit -1
cd ..
make dmlc=dmlc-core CXX=${CXX} || exit -1
fi
if [ ${TASK} == "R-package" ]; then
scripts/travis_R_script.sh || exit -1
fi
if [ ${TASK} == "python-package" ]; then
make all CXX=${CXX} || exit -1
nosetests tests/python || exit -1
fi