Skip to content

Commit

Permalink
Add logging and ensure phpunit.xml exists to fix configuration errors
Browse files Browse the repository at this point in the history
- Add logging steps to display directory structures for the repository, tooling folder, and test suite directory.
- Update .env file creation to set PLUGIN_DIR=${GITHUB_WORKSPACE} (repository root).
- Add a step to copy phpunit.xml.dist to phpunit.xml if phpunit.xml is missing.
- Ensure the workspace artifact includes hidden files.
- This provides detailed visibility of the environment and fixes the missing phpunit.xml error.
  • Loading branch information
zackkatz committed Feb 17, 2025
1 parent 607d190 commit 5104326
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ jobs:
exit 1
fi
- name: Ensure phpunit.xml exists in PLUGIN_DIR
run: |
source "$HOME/tooling/docker-unit-tests/.env"
if [ ! -f "$PLUGIN_DIR/phpunit.xml" ] && [ -f "$PLUGIN_DIR/phpunit.xml.dist" ]; then
cp "$PLUGIN_DIR/phpunit.xml.dist" "$PLUGIN_DIR/phpunit.xml"
echo "Created phpunit.xml from phpunit.xml.dist"
else
echo "phpunit.xml exists or phpunit.xml.dist not found."
fi
- name: Run PHP 7.4 Unit Tests
run: |
export ENV_FILE="$HOME/tooling/docker-unit-tests/.env"
Expand Down Expand Up @@ -200,6 +210,16 @@ jobs:
echo "Test suite is configured."
fi
- name: Ensure phpunit.xml exists in PLUGIN_DIR
run: |
source "$HOME/tooling/docker-unit-tests/.env"
if [ ! -f "$PLUGIN_DIR/phpunit.xml" ] && [ -f "$PLUGIN_DIR/phpunit.xml.dist" ]; then
cp "$PLUGIN_DIR/phpunit.xml.dist" "$PLUGIN_DIR/phpunit.xml"
echo "Created phpunit.xml from phpunit.xml.dist"
else
echo "phpunit.xml exists or phpunit.xml.dist not found."
fi
- name: Run PHP 8.0 Unit Tests
run: |
export ENV_FILE="$HOME/tooling/docker-unit-tests/.env"
Expand Down

0 comments on commit 5104326

Please sign in to comment.