Nightly #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly | |
| on: | |
| schedule: | |
| - cron: "17 3 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| only: | |
| description: "Which jobs to run" | |
| required: false | |
| default: all | |
| type: choice | |
| options: [all, bench, thrash] | |
| concurrency: | |
| group: nightly | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| compaction-thrash-sweep: | |
| name: Safety / GC Compaction Pause & Churn Thrash Sweep | |
| if: inputs.only != 'bench' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| extensions: apcu, shmop, sysvsem, zlib, opcache | |
| ini-values: apc.enable_cli=1, apc.shm_size=512M | |
| coverage: none | |
| - name: Install ext-judy via PIE (with retries & exponential backoff) | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 | |
| retry_wait_seconds: 5 | |
| command: | | |
| curl --retry 5 --retry-delay 2 --retry-max-time 60 --retry-all-errors --retry-connrefused -fsSL https://github.com/php/pie/releases/latest/download/pie.phar -o /usr/local/bin/pie | |
| chmod +x /usr/local/bin/pie | |
| sudo pie install orieg/judy | |
| - name: Assert runtime dependency floor (ext-judy >= 2.6.0) | |
| run: | | |
| php -r ' | |
| $v = function_exists("judy_version") ? judy_version() : null; | |
| echo "ext-judy version: ", ($v ?? "not found"), PHP_EOL; | |
| if ($v === null || version_compare($v, "2.6.0", "<")) { | |
| fwrite(STDERR, "::error::Runtime dependency floor assertion failed: ext-judy >= 2.6.0 required, got " . ($v ?? "none") . "\n"); | |
| exit(1); | |
| } | |
| echo "Runtime version floor check passed: " . $v . "\n"; | |
| ' | |
| - name: Resilient Composer install | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 | |
| retry_wait_seconds: 5 | |
| command: composer install --no-interaction --no-progress | |
| - name: Model-based deep fuzz (50k ops) | |
| run: php tests/fuzz.php 50000 | |
| - name: Deep Compaction Pause & Churn Thrash Gate | |
| run: php tests/compaction-thrash.php --full | |
| - name: Deep Multi-Worker Simulation | |
| run: php examples/multi-worker/demo.php 8 15000 4096 50 | |
| - name: Deep Owner-Process IPC Stress | |
| run: php examples/owner-process/demo.php 8 20000 | |
| - name: Large-Value Storage Shootout | |
| run: php examples/large-values/demo.php 40000 4096 100 8 | |
| - name: Generate Nightly Step Summary | |
| if: always() | |
| run: | | |
| cat <<EOF >> "$GITHUB_STEP_SUMMARY" | |
| ## 🛡️ Nightly Compaction Pause & Churn Thrash Sweep | |
| - **Environment**: PHP 8.4, ext-judy $(php -r 'echo function_exists("judy_version") ? judy_version() : "n/a";') | |
| - **Compaction Pause Ceiling**: <= 1.0 ms (asserted) | |
| - **Concurrency Deadlock Count**: 0 (asserted) | |
| - **Result**: ${{ job.status == 'success' && '🟢 PASS' || '🔴 FAIL' }} | |
| EOF | |
| - name: Report or Update Nightly Failure Issue | |
| if: failure() && github.event_name == 'schedule' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = '🚨 [Nightly CI Failure] Compaction Pause / Churn Thrash Verification Failed on main'; | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| labels: 'nightly-failure' | |
| }); | |
| const existing = issues.find(i => i.title.includes('Compaction Pause')); | |
| const body = [ | |
| '### Nightly Verification Failure Alert', | |
| '', | |
| `- **Commit**: [${context.sha}](${context.payload.repository?.html_url}/commit/${context.sha})`, | |
| `- **Workflow Run**: [View Failed Run Logs](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`, | |
| '- **Failing Target**: `php tests/compaction-thrash.php --full`', | |
| '', | |
| '#### Local Reproduction Command:', | |
| '```bash', | |
| 'php tests/compaction-thrash.php --full', | |
| 'php examples/multi-worker/demo.php 8 15000 4096 50', | |
| '```' | |
| ].join('\n'); | |
| if (existing) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: existing.number, | |
| body: `⚠️ Nightly run still failing on commit ${context.sha}. [View Run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})` | |
| }); | |
| } else { | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: title, | |
| body: body, | |
| labels: ['bug', 'nightly-failure', 'automated-triage'] | |
| }); | |
| } | |
| - name: Auto-Close Resolved Nightly Issue on Success | |
| if: success() && github.event_name == 'schedule' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| labels: 'nightly-failure' | |
| }); | |
| const existing = issues.find(i => i.title.includes('Compaction Pause')); | |
| if (existing) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: existing.number, | |
| body: `🟢 Nightly verification succeeded on commit ${context.sha}! Auto-closing this issue.` | |
| }); | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: existing.number, | |
| state: 'closed' | |
| }); | |
| } | |
| bench-deep: | |
| name: Perf / Nightly Multi-Backend Benchmark Deep Sweep | |
| if: inputs.only != 'thrash' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| extensions: apcu, shmop, sysvsem, zlib | |
| ini-values: apc.enable_cli=1, apc.shm_size=1024M | |
| coverage: none | |
| - name: Install ext-judy via PIE (with retries & exponential backoff) | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 | |
| retry_wait_seconds: 5 | |
| command: | | |
| curl --retry 5 --retry-delay 2 --retry-max-time 60 --retry-all-errors --retry-connrefused -fsSL https://github.com/php/pie/releases/latest/download/pie.phar -o /usr/local/bin/pie | |
| chmod +x /usr/local/bin/pie | |
| sudo pie install orieg/judy | |
| - name: Assert runtime dependency floor (ext-judy >= 2.6.0) | |
| run: | | |
| php -r ' | |
| $v = function_exists("judy_version") ? judy_version() : null; | |
| echo "ext-judy version: ", ($v ?? "not found"), PHP_EOL; | |
| if ($v === null || version_compare($v, "2.6.0", "<")) { | |
| fwrite(STDERR, "::error::Runtime dependency floor assertion failed: ext-judy >= 2.6.0 required, got " . ($v ?? "none") . "\n"); | |
| exit(1); | |
| } | |
| ' | |
| - name: Resilient Composer install | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 | |
| retry_wait_seconds: 5 | |
| command: composer install --no-interaction --no-progress | |
| - name: Run deep benchmark sweep (median of 7) | |
| run: | | |
| php bench/cache-bench.php 100000,500000,2000000 7 | tee nightly-bench-results.md | |
| echo "" >> nightly-bench-results.md | |
| echo "### Large-Value Storage & Multi-Worker Shootout (Deep Sweep)" >> nightly-bench-results.md | |
| echo '```' >> nightly-bench-results.md | |
| php examples/large-values/demo.php 30000 4096 100 8 >> nightly-bench-results.md | |
| echo '```' >> nightly-bench-results.md | |
| - name: Append benchmark summary to GITHUB_STEP_SUMMARY | |
| if: always() | |
| run: | | |
| { | |
| echo "## ⚡ judy-cache Nightly Deep Benchmark Results" | |
| echo "" | |
| cat nightly-bench-results.md | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload benchmark artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nightly-bench-results | |
| path: nightly-bench-results.md |