From 7f8697ca381b66128c4d30c0d859144e11a05c48 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 11 Jul 2016 10:36:47 -0700 Subject: [PATCH] Add dev-lib and use for dogfooding rulesets in Travis CI builds --- .gitmodules | 4 ++++ .travis.yml | 15 ++++++++++----- dev-lib | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .gitmodules create mode 160000 dev-lib diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..a2da7e17ea --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "dev-lib"] + path = dev-lib + url = https://github.com/xwp/wp-dev-lib.git + branch = master diff --git a/.travis.yml b/.travis.yml index c6d71fbf72..4c1566b43b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,12 +31,17 @@ matrix: - php: hhvm - env: PHPCS_BRANCH=3.0 -before_script: +install: + - export DEV_LIB_PATH=dev-lib + - export DEV_LIB_SKIP=composer + - if [ ! -e "$DEV_LIB_PATH" ] && [ -L .travis.yml ]; then export DEV_LIB_PATH=$( dirname $( readlink .travis.yml ) ); fi + - if [ ! -e "$DEV_LIB_PATH" ]; then git clone https://github.com/xwp/wp-dev-lib.git $DEV_LIB_PATH; fi - export PHPCS_DIR=/tmp/phpcs - - export PHPCS_BIN=$(if [[ $PHPCS_BRANCH == 3.0 ]]; then echo $PHPCS_DIR/bin/phpcs; else echo $PHPCS_DIR/scripts/phpcs; fi) - mkdir -p $PHPCS_DIR && git clone --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git -b $PHPCS_BRANCH $PHPCS_DIR - - $PHPCS_BIN --config-set installed_paths $(pwd) + - export PHPCS_BIN_DIR=$(if [[ $PHPCS_BRANCH == 3.0 ]]; then echo $PHPCS_DIR/bin; else echo $PHPCS_DIR/scripts; fi) + - export PATH="$PHPCS_BIN_DIR:$PATH" + - phpcs --config-set installed_paths $(pwd) + - source $DEV_LIB_PATH/travis.install.sh script: - - if find . -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; - - phpunit --filter WordPress /tmp/phpcs/tests/AllTests.php + - source $DEV_LIB_PATH/travis.script.sh diff --git a/dev-lib b/dev-lib new file mode 160000 index 0000000000..449182d561 --- /dev/null +++ b/dev-lib @@ -0,0 +1 @@ +Subproject commit 449182d5615568beb5a406dbc5358004c29896ed