Update ci.yml

This commit is contained in:
2025-12-18 16:24:20 -06:00
parent 3047868cbb
commit ea30e82068

View File

@@ -23,42 +23,43 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Python - name: Ensure script executability
uses: actions/setup-python@v5 shell: bash
with: run: |
python-version: "3.11" set -euo pipefail
chmod +x scripts/*.sh 2>/dev/null || true
- name: Run fix_tabs.py if present - name: Run fix_tabs.sh if present
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cd "${GITHUB_WORKSPACE}" cd "${GITHUB_WORKSPACE}"
if [ -f "scripts/fix_tabs.py" ]; then if [ -f "scripts/fix_tabs.sh" ]; then
echo "Running scripts/fix_tabs.py" echo "Running scripts/fix_tabs.sh"
python scripts/fix_tabs.py bash scripts/fix_tabs.sh
else else
echo "scripts/fix_tabs.py not found. Skipping." echo "scripts/fix_tabs.sh not found. Skipping."
fi fi
- name: Run fix_paths.py if present - name: Run fix_paths.sh if present
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cd "${GITHUB_WORKSPACE}" cd "${GITHUB_WORKSPACE}"
if [ -f "scripts/fix_paths.py" ]; then if [ -f "scripts/fix_paths.sh" ]; then
echo "Running scripts/fix_paths.py" echo "Running scripts/fix_paths.sh"
python scripts/fix_paths.py bash scripts/fix_paths.sh
else else
echo "scripts/fix_paths.py not found. Skipping." echo "scripts/fix_paths.sh not found. Skipping."
fi
fi fi
- name: Fail if formatting scripts modified files - name: Fail if formatting scripts modified files
shell: bash
run: | run: |
set -e set -euo pipefail
if ! git diff --quiet; then if ! git diff --quiet; then
echo "Formatting scripts introduced changes." echo "Formatting scripts introduced changes."
echo "Run fix_tabs.py and fix_paths.py locally and commit the results." echo "Run fix_tabs.sh and fix_paths.sh locally and commit the results."
git diff git diff
exit 1 exit 1
fi fi
@@ -79,7 +80,9 @@ jobs:
coverage: none coverage: none
- name: Lint PHP files under src - name: Lint PHP files under src
shell: bash
run: | run: |
set -euo pipefail
if [ -d "src" ]; then if [ -d "src" ]; then
echo "Running php -l against PHP files in src/" echo "Running php -l against PHP files in src/"
find src -type f -name "*.php" -print0 | xargs -0 -n 1 -P 4 php -l find src -type f -name "*.php" -print0 | xargs -0 -n 1 -P 4 php -l
@@ -103,7 +106,9 @@ jobs:
coverage: none coverage: none
- name: Install dependencies if composer.json exists - name: Install dependencies if composer.json exists
shell: bash
run: | run: |
set -euo pipefail
if [ -f "composer.json" ]; then if [ -f "composer.json" ]; then
composer install --no-interaction --no-progress --prefer-dist composer install --no-interaction --no-progress --prefer-dist
else else
@@ -111,7 +116,9 @@ jobs:
fi fi
- name: Run Composer tests when defined - name: Run Composer tests when defined
shell: bash
run: | run: |
set -euo pipefail
if [ ! -f "composer.json" ]; then if [ ! -f "composer.json" ]; then
echo "No composer.json. Nothing to test." echo "No composer.json. Nothing to test."
exit 0 exit 0
@@ -137,40 +144,45 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run manifest validation script if present - name: Ensure script executability
shell: bash
run: | run: |
set -e set -euo pipefail
chmod +x scripts/*.sh 2>/dev/null || true
- name: Run manifest validation script if present
shell: bash
run: |
set -euo pipefail
echo "Checking for manifest validation scripts" echo "Checking for manifest validation scripts"
if [ -x "scripts/validate_manifest.sh" ]; then if [ -f "scripts/validate_manifest.sh" ]; then
echo "Running scripts/validate_manifest.sh" echo "Running scripts/validate_manifest.sh"
scripts/validate_manifest.sh bash scripts/validate_manifest.sh
elif [ -f "scripts/validate_manifest.php" ]; then elif [ -f "scripts/validate_manifest.php" ]; then
echo "Running scripts/validate_manifest.php" echo "Running scripts/validate_manifest.php"
php scripts/validate_manifest.php php scripts/validate_manifest.php
elif [ -f "scripts/validate_manifest.py" ]; then
echo "Running scripts/validate_manifest.py"
python scripts/validate_manifest.py
else else
echo "No manifest validation script found (scripts/validate_manifest.*). Skipping manifest validation step." echo "No manifest validation script found (scripts/validate_manifest.sh or scripts/validate_manifest.php). Skipping manifest validation step."
fi fi
- name: Run changelog update or verification script if present - name: Run changelog update or verification script if present
shell: bash
run: | run: |
set -e set -euo pipefail
echo "Checking for changelog update or verification scripts" echo "Checking for changelog update or verification scripts"
if [ -x "scripts/update_changelog.sh" ]; then if [ -f "scripts/update_changelog.sh" ]; then
echo "Running scripts/update_changelog.sh --ci" echo "Running scripts/update_changelog.sh --ci"
scripts/update_changelog.sh --ci bash scripts/update_changelog.sh --ci
elif [ -f "scripts/update_changelog.py" ]; then elif [ -f "scripts/verify_changelog.sh" ]; then
echo "Running scripts/update_changelog.py --ci"
python scripts/update_changelog.py --ci
elif [ -x "scripts/verify_changelog.sh" ]; then
echo "Running scripts/verify_changelog.sh" echo "Running scripts/verify_changelog.sh"
scripts/verify_changelog.sh bash scripts/verify_changelog.sh
elif [ -f "scripts/verify_changelog.php" ]; then
echo "Running scripts/verify_changelog.php"
php scripts/verify_changelog.php
else else
echo "No changelog script found (scripts/update_changelog.* or scripts/verify_changelog.sh). Skipping changelog enforcement." echo "No changelog script found (scripts/update_changelog.sh, scripts/verify_changelog.sh, or scripts/verify_changelog.php). Skipping changelog enforcement."
exit 0 exit 0
fi fi