CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.1) (pull_request) Successful in 56s
CI / Tests (PHP 8.2) (pull_request) Successful in 57s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m56s
CI / Coding Standards (pull_request) Successful in 7m5s
CI / Build Plugin Zip (pull_request) Skipped
CI / PHPStan (pull_request) Successful in 8m5s
The GitHub API rate limit was the wrong diagnosis, so this reverts the 1Password-backed token added in #175 along with the mirrored composite action, leaving the workflows as they were. Timing every Setup PHP step across runs 454-523 rules the rate limit out. PHP 8.1 and 8.2 install in 26-41 seconds, 12 for 12, never once failing. PHP 8.3 has never finished in under 143 seconds and ranges up to 1273, with two outright failures. Those jobs share a fan-out, and so an egress address and a rate limit bucket, with the 8.1 and 8.2 jobs that are never touched. A throttle could not sort itself by PHP version that way. Run 523, the first to carry the token, is the direct refutation: the token resolved and verified, and Setup PHP still took 749 seconds on kallone and 408 on eris. The 8.3 penalty also predates the whole story, sitting at ~145 seconds back on 30 July. What is left is a slow path specific to 8.3 on these arm64 runners, whose long tail sometimes crosses the step timeout and reports the unhelpful "Could not setup PHP 8.3". That is worth fixing on its own terms rather than behind a token that was never in the path. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Uw545F1vveNJKjzLxdi2ks
144 lines
3.9 KiB
YAML
144 lines
3.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
name: Coding Standards
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
tools: composer:v2
|
|
|
|
- name: Cache Composer packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.composer/cache
|
|
key: composer-${{ hashFiles('composer.json') }}
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress --no-interaction
|
|
|
|
- name: Run PHPCS
|
|
run: composer cs
|
|
|
|
|
|
static-analysis:
|
|
name: PHPStan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
tools: composer:v2
|
|
|
|
- name: Cache Composer packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.composer/cache
|
|
key: composer-${{ hashFiles('composer.json') }}
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress --no-interaction
|
|
|
|
- name: Run PHPStan
|
|
run: composer lint
|
|
|
|
test:
|
|
name: Tests (PHP ${{ matrix.php }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php:
|
|
- '8.1'
|
|
- '8.2'
|
|
- '8.3'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: mbstring, intl
|
|
coverage: none
|
|
tools: composer:v2
|
|
|
|
- name: Cache Composer packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.composer/cache
|
|
key: ${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress --no-interaction
|
|
|
|
- name: Run PHPUnit
|
|
run: composer test
|
|
|
|
no-debug:
|
|
name: No Debug Code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check for debug statements
|
|
run: |
|
|
# \b keeps method calls like DateTimeImmutable::add() from matching dd(.
|
|
if grep -rn --include="*.php" -E "\b(var_dump|var_export|print_r|error_log|dd|dump)\s*\(" src/; then
|
|
echo "Debug code found in src/ — please remove before merging."
|
|
exit 1
|
|
fi
|
|
|
|
build:
|
|
name: Build Plugin Zip
|
|
runs-on: ubuntu-latest
|
|
# Only build a shippable artifact once changes land on main, and only
|
|
# after the quality gates pass.
|
|
needs: [lint, static-analysis, test, no-debug]
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
tools: composer:v2
|
|
|
|
- name: Build plugin zip
|
|
run: composer build
|
|
|
|
- name: Read plugin version
|
|
id: meta
|
|
run: |
|
|
version="$(sed -nE 's/^[[:space:]]*\*?[[:space:]]*Version:[[:space:]]*([^[:space:]]+).*/\1/p' unsupervised-schedular.php | head -1)"
|
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
|
|
# Gitea/Actions re-zips artifacts on download. Upload the unpacked plugin
|
|
# folder (not the built zip) so the downloaded archive's top level is
|
|
# unsupervised-schedular/ and installs directly in WordPress. Uploading
|
|
# the zip instead double-wraps it ("No valid plugins were found").
|
|
- name: Unpack plugin for artifact
|
|
run: unzip -q "dist/unsupervised-schedular-${{ steps.meta.outputs.version }}.zip" -d artifact
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: unsupervised-schedular-${{ steps.meta.outputs.version }}
|
|
path: artifact/
|
|
if-no-files-found: error
|