Skip to content

Commit

Permalink
Refactor GitHub Actions workflow to improve PHPUnit configuration and…
Browse files Browse the repository at this point in the history
… debugging

- Updated the workflow to create a phpunit.xml file dynamically instead of copying it from the .github/drupal directory, ensuring the correct configuration is always used.
- Enhanced debug output by displaying workspace paths and current directory contents, aiding in troubleshooting.
- Improved visibility of the directory structure before and after copying project files, facilitating better understanding of the testing environment.

These changes enhance the reliability and clarity of the testing framework, streamlining the testing process for developers.
  • Loading branch information
ivangrynenko committed Jan 22, 2025
1 parent 984916d commit 6de5654
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,35 @@ jobs:
- name: Run tests
working-directory: /var/www/html
run: |
echo "Current directory structure before copy:"
pwd
ls -la $GITHUB_WORKSPACE/.github/drupal
echo "phpunit.xml location:"
find $GITHUB_WORKSPACE -name phpunit.xml
echo "Debug workspace paths:"
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
echo "Current directory: $(pwd)"
echo "Workspace contents:"
ls -la $GITHUB_WORKSPACE
# Copy project files to working directory
cp -r $GITHUB_WORKSPACE/. .
# Copy phpunit.xml from .github/drupal
cp $GITHUB_WORKSPACE/.github/drupal/phpunit.xml .
echo "Current directory structure after copy:"
pwd
ls -la
echo "Working directory phpunit.xml:"
# Create phpunit.xml
cat > phpunit.xml << 'EOL'
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
</phpunit>
EOL

echo "PHPUnit config contents:"
cat phpunit.xml

# Install dependencies
Expand Down

0 comments on commit 6de5654

Please sign in to comment.