Fix GitHub Actions workflow failures

- Add WP_PHPUNIT__DIR and WP_TESTS_DIR environment variables to PHPUnit workflow to fix 'WP_UnitTestCase not found' error
- Increase WordPress Playground server timeout from 60s to 180s with better progress logging to fix timeout failures
- Add conditional checks for SONAR_TOKEN and CODACY_PROJECT_TOKEN to gracefully skip analysis when tokens are not set
- Properly handle server process lifecycle in Playground tests (capture PID, kill on completion)
This commit is contained in:
2025-11-24 19:35:03 +00:00
parent eb388a846d
commit 1590be3ba6
6 changed files with 100 additions and 11 deletions

View File

@@ -27,7 +27,18 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Check if SonarCloud token is set
id: check_token
run: |
if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then
echo "SONAR_TOKEN is not set, skipping SonarCloud analysis"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: SonarCloud Scan
if: steps.check_token.outputs.skip != 'true'
uses: SonarSource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any