Skip to content

Commit 14bfeec

Browse files
authored
Workflows
1 parent 492da5a commit 14bfeec

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/php-code-quality.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ jobs:
101101
102102
# Try to auto-fix compatibility issues where possible
103103
vendor/bin/phpcbf --standard=phpcs.xml --extensions=php --ignore=vendor/,node_modules/ . || true
104-
104+
105105
# Run the actual compatibility check
106-
vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor/,node_modules/ . || {
106+
if ! vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor/,node_modules/ .; then
107107
echo "Error: The phpcs.xml standard may have issues with PHPCompatibility reference."
108108
echo "Trying with direct PHPCompatibility standard..."
109-
109+
110110
# Create a backup of the original phpcs.xml
111111
cp phpcs.xml phpcs.xml.bak
112-
112+
113113
# Create a simple phpcs configuration file that directly references PHPCompatibility
114114
cat > phpcs-compat.xml << 'EOF'
115115
<?xml version="1.0"?>
@@ -124,11 +124,11 @@ jobs:
124124
<exclude-pattern>/node_modules/*</exclude-pattern>
125125
</ruleset>
126126
EOF
127-
127+
128128
# Try with the temporary configuration and ensure installed_paths is set correctly
129129
vendor/bin/phpcs --config-set installed_paths ${ABSOLUTE_PHPCOMP_PATH},${ABSOLUTE_WPCS_PATH}
130130
vendor/bin/phpcs --standard=phpcs-compat.xml --extensions=php --ignore=vendor/,node_modules/ .
131-
}
131+
fi
132132

133133
- name: Fix text argument escaping issues
134134
run: |

.github/workflows/wordpress-tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,8 @@ jobs:
207207
208208
# Run the script with detailed logging
209209
echo "Installing WordPress test environment for version $WP_VERSION..."
210-
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION || {
211-
echo "::error::Failed to setup WordPress test environment. Showing detailed error information:"
212-
find /tmp -name "wordpress-tests-lib-install-*.log" -exec cat {} \; 2>/dev/null || echo "No install logs found."
213-
ls -la /tmp/wordpress-tests-lib || echo "/tmp/wordpress-tests-lib directory not found"
214-
210+
if ! bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION; then
211+
echo "error"
215212
# Try one more time with explicitly created directory
216213
echo "Retrying WordPress test environment setup..."
217214
sudo rm -rf /tmp/wordpress-tests-lib || echo "Failed to remove old test dir"
@@ -222,7 +219,7 @@ jobs:
222219
export WP_TESTS_DIR=/tmp/wordpress-tests-lib
223220
echo "WP_TESTS_DIR=$WP_TESTS_DIR" >> $GITHUB_ENV
224221
225-
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION || {
222+
if ! bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION; then
226223
echo "::error::Failed to setup WordPress test environment on second attempt."
227224
228225
# Last resort - try manually setting up core files
@@ -253,7 +250,7 @@ jobs:
253250
exit 1
254251
fi
255252
}
256-
}
253+
fi
257254
258255
# Verify the test environment was created successfully
259256
if [ ! -d "/tmp/wordpress-tests-lib" ]; then

0 commit comments

Comments
 (0)