Skip to content

Commit 936b520

Browse files
authored
Workflows
1 parent 795ef32 commit 936b520

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/wordpress-tests.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,19 @@ jobs:
274274
fi
275275
276276
# Verify files in both locations
277-
if [ -f "/wordpress-tests-lib/includes/functions.php" ]; then
278-
echo "WordPress test files successfully copied to /wordpress-tests-lib/"
279-
else
280-
echo "::warning::Files may be missing in /wordpress-tests-lib, creating core files if needed"
281-
sudo mkdir -p /wordpress-tests-lib/includes/
282-
if ! sudo cp -f /tmp/wordpress-tests-lib/includes/functions.php /wordpress-tests-lib/includes/; then echo "::warning::Failed to copy functions.php"; fi
283-
if ! sudo cp -f /tmp/wordpress-tests-lib/wp-tests-config.php /wordpress-tests-lib/; then echo "::warning::Failed to copy wp-tests-config.php"; fi
284-
fi
277+
if [ -f "/wordpress-tests-lib/includes/functions.php" ]; then
278+
echo "WordPress test files successfully copied to /wordpress-tests-lib/"
279+
else
280+
echo "::warning::Files may be missing in /wordpress-tests-lib, creating core files if needed"
281+
sudo mkdir -p /wordpress-tests-lib/includes/
282+
if ! sudo cp -f /tmp/wordpress-tests-lib/includes/functions.php /wordpress-tests-lib/includes/; then echo "::warning::Failed to copy functions.php"; fi
283+
if ! sudo cp -f /tmp/wordpress-tests-lib/wp-tests-config.php /wordpress-tests-lib/; then echo "::warning::Failed to copy wp-tests-config.php"; fi
284+
fi
285285

286286
# Create or copy required class-basic-object.php file if missing
287-
if [ ! -f "/tmp/wordpress-tests-lib/includes/class-basic-object.php" ]; then
288-
echo "Creating missing class-basic-object.php file in /tmp/wordpress-tests-lib..."
289-
cat > /tmp/wordpress-tests-lib/includes/class-basic-object.php << 'EOF'
287+
if [ ! -f "/tmp/wordpress-tests-lib/includes/class-basic-object.php" ]; then
288+
echo "Creating missing class-basic-object.php file in /tmp/wordpress-tests-lib..."
289+
(cat <<'EOF' > /tmp/wordpress-tests-lib/includes/class-basic-object.php
290290
<?php
291291
/**
292292
* Basic object, which other objects in WordPress extend.
@@ -310,7 +310,8 @@ class Basic_Object {
310310
}
311311
}
312312
EOF
313-
fi
313+
)
314+
fi
314315

315316
# Copy to the alternate path as well
316317
if [ ! -f "/wordpress-tests-lib/includes/class-basic-object.php" ]; then

0 commit comments

Comments
 (0)