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:
11
.github/workflows/sonarcloud.yml
vendored
11
.github/workflows/sonarcloud.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user