Skip to content

Commit c34fcf2

Browse files
authored
Workflows
1 parent 14bfeec commit c34fcf2

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,10 @@ jobs:
104104
105105
# Run the actual compatibility check
106106
if ! vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor/,node_modules/ .; then
107-
echo "Error: The phpcs.xml standard may have issues with PHPCompatibility reference."
108-
echo "Trying with direct PHPCompatibility standard..."
109-
110-
# Create a backup of the original phpcs.xml
111-
cp phpcs.xml phpcs.xml.bak
112-
113-
# Create a simple phpcs configuration file that directly references PHPCompatibility
114-
cat > phpcs-compat.xml << 'EOF'
107+
echo "Error: The phpcs.xml standard may have issues with PHPCompatibility reference."
108+
echo "Trying with direct PHPCompatibility standard..."
109+
cp phpcs.xml phpcs.xml.bak
110+
cat > phpcs-compat.xml << 'EOF'
115111
<?xml version="1.0"?>
116112
<ruleset name="PHP Compatibility Check">
117113
<description>Check PHP compatibility for WordPress plugin</description>
@@ -124,11 +120,9 @@ jobs:
124120
<exclude-pattern>/node_modules/*</exclude-pattern>
125121
</ruleset>
126122
EOF
127-
128-
# Try with the temporary configuration and ensure installed_paths is set correctly
129-
vendor/bin/phpcs --config-set installed_paths ${ABSOLUTE_PHPCOMP_PATH},${ABSOLUTE_WPCS_PATH}
130-
vendor/bin/phpcs --standard=phpcs-compat.xml --extensions=php --ignore=vendor/,node_modules/ .
131-
fi
123+
vendor/bin/phpcs --config-set installed_paths ${ABSOLUTE_PHPCOMP_PATH},${ABSOLUTE_WPCS_PATH}
124+
vendor/bin/phpcs --standard=phpcs-compat.xml --extensions=php --ignore=vendor/,node_modules/ .
125+
fi
132126

133127
- name: Fix text argument escaping issues
134128
run: |

.github/workflows/wordpress-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ jobs:
267267
# Ensure files are also available at non-tmp path (for scripts that may hardcode the path)
268268
echo "Syncing files to the /wordpress-tests-lib directory..."
269269
sudo mkdir -p /wordpress-tests-lib/includes/
270-
sudo cp -R /tmp/wordpress-tests-lib/* /wordpress-tests-lib/ || {
270+
if ! sudo cp -R /tmp/wordpress-tests-lib/* /wordpress-tests-lib/; then
271271
echo "::warning::Failed to copy files to /wordpress-tests-lib - trying with rsync"
272272
sudo apt-get install -y rsync
273273
sudo rsync -a /tmp/wordpress-tests-lib/ /wordpress-tests-lib/ || echo "::warning::Failed to sync files with rsync"
274-
}
274+
fi
275275
276276
# Verify files in both locations
277277
if [ -f "/wordpress-tests-lib/includes/functions.php" ]; then

0 commit comments

Comments
 (0)