Skip to content

Commit

Permalink
Travis: organize env var declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
JDGrimes committed Feb 18, 2015
1 parent d7d1d10 commit 468d5f9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,44 @@
set -e
shopt -s expand_aliases

# Paths
export WP_TESTS_DIR=/tmp/wordpress-tests/
export PROJECT_DIR=$(pwd)/src
export PROJECT_SLUG=$(basename "$(pwd)" | sed 's/^wp-//')
CODESNIFF_PATH=(. '!' -path "./$DEV_LIB_PATH/*" '!' -path "./vendor/*")
export CODESNIFF_PATH

# PHPCS
export DO_PHPCS=$(if [ -e phpcs.ruleset.xml ]; then echo 1; else echo 0; fi)
export PHPCS_DIR=/tmp/phpcs
export PHPCS_GITHUB_SRC=squizlabs/PHP_CodeSniffer
export PHPCS_GIT_TREE=master

# WPCS
export WPCS_DIR=/tmp/wpcs
export WPCS_GITHUB_SRC=WordPress-Coding-Standards/WordPress-Coding-Standards
export WPCS_GIT_TREE=923b63a15c4b9a61f08ab059c3f9e7efa85cb31d
export WPCS_STANDARD=$(if [ -e phpcs.ruleset.xml ]; then echo phpcs.ruleset.xml; else echo WordPress; fi)
CODESNIFF_PATH=(. '!' -path "./$DEV_LIB_PATH/*" '!' -path "./vendor/*")
export CODESNIFF_PATH

# State
export RUN_UNINSTALL_TESTS=$(if grep -q '<group>uninstall</group>' phpunit.xml.dist; then echo 1; else echo 0; fi)
export RUN_AJAX_TESTS=$(if grep -q '<group>ajax</group>' phpunit.xml.dist; then echo 1; else echo 0; fi)
export DO_CODE_COVERAGE=$(if [[ $TRAVIS_PHP_VERSION == hhvm ]] && [ -e .coveralls.yml ]; then echo 1; else echo 0; fi)

# WordPoints
if [[ -z $WORDPOINTS_VERSION ]]; then
export WORDPOINTS_VERSION=master
fi

# Load commands.
source "$DEV_LIB_PATH"/travis/commands.sh

# Load customisation.
if [ -e .ci-env.sh ]; then
source .ci-env.sh
fi

# Set up.
if [[ $TRAVISCI_RUN == phpunit ]]; then
setup-phpunit
elif [[ $TRAVISCI_RUN == codesniff ]]; then
Expand Down

0 comments on commit 468d5f9

Please sign in to comment.