Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
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
27 changes: 23 additions & 4 deletions check-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ function run_phpunit_travisci {
echo "Skipping PHPUnit as requested via DEV_LIB_SKIP / DEV_LIB_ONLY"
return
fi
if [ "$PROJECT_TYPE" != plugin ] && [ "$PROJECT_TYPE" != site ]; then
echo "Skipping PHPUnit since only applicable to site or plugin project types"
if [ "$PROJECT_TYPE" != plugin ] && [ "$PROJECT_TYPE" != site ] && [ "$PROJECT_TYPE" != theme ]; then
echo "Skipping PHPUnit since only applicable to site, theme or plugin project types"
return
fi
echo
Expand Down Expand Up @@ -703,9 +703,28 @@ function run_phpunit_travisci {

# Rsync the files into the right location
mkdir -p "$INSTALL_PATH"
rsync -a $(verbose_arg) --exclude .git/hooks --delete "$PROJECT_DIR/" "$INSTALL_PATH/"
rsync -a $(verbose_arg) --exclude .git --delete "$PROJECT_DIR/" "$INSTALL_PATH/"
cd "$INSTALL_PATH"

echo "Location: $INSTALL_PATH"
elif [ "$PROJECT_TYPE" == theme ]; then
INSTALL_PATH="$WP_CORE_DIR/src/wp-content/themes/$PROJECT_SLUG"

# Rsync the files into the right location
mkdir -p "$INSTALL_PATH"
rsync -a $(verbose_arg) --exclude .git --delete "$PROJECT_DIR/" "$INSTALL_PATH/"
cd "$INSTALL_PATH"

# Clone the theme dependencies (i.e. plugins) into the plugins directory
if [ ! -z "$THEME_GIT_PLUGIN_DEPENDENCIES" ]; then
IFS=',' read -r -a dependencies <<< "$THEME_GIT_PLUGIN_DEPENDENCIES"
for dep in "${dependencies[@]}"
do
filename=$(basename "$dep")
git clone "$dep" "$WP_CORE_DIR/src/wp-content/plugins/${filename%.*}"
done
fi

echo "Location: $INSTALL_PATH"
elif [ "$PROJECT_TYPE" == site ]; then
cd "$PROJECT_DIR"
Expand All @@ -717,7 +736,7 @@ function run_phpunit_travisci {

INITIAL_DIR=$(pwd)
if [ -n "$PHPUNIT_CONFIG" ]; then
phpunit $( if [ -n "$PHPUNIT_CONFIG" ]; then echo -c "$PHPUNIT_CONFIG"; fi )
phpunit $( if [ -n "$PHPUNIT_CONFIG" ]; then echo -c "$PHPUNIT_CONFIG"; fi ) $(coverage_clover)
else
for project in $( find_phpunit_dirs ); do
(
Expand Down
4 changes: 2 additions & 2 deletions travis.after_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e
set -v

if can_generate_coverage_clover && [ -s "$TEMP_DIRECTORY/paths-scope-php" ] && [ -n "$PHPUNIT_COVERAGE_DIR" ]; then
cd "$PHPUNIT_COVERAGE_DIR"
if can_generate_coverage_clover && [ -s "$TEMP_DIRECTORY/paths-scope-php" ] && [ -n "$INITIAL_DIR" ]; then
cd "$INITIAL_DIR"
php vendor/bin/coveralls -vvv
cd - > /dev/null
fi