From 031f59000aa93cdb17e47e08c1913958c6a367da Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 11 Sep 2026 20:27:51 +0200 Subject: [PATCH 1/3] [CI] Trim wasteful and risky workflows - remove benchmark_phpunit.yaml (2h cron vanity benchmark, no gate) - drop automerge from weekly_pull_requests.yaml (keep PR, require human merge) - slow poll_siblings_rebuild cron 15min -> hourly - slow tests_windows cron 3h -> daily Claude-Session: https://claude.ai/code/session_01UMmvbzh8rGXtLypa1vCW1m --- .github/workflows/benchmark_phpunit.yaml | 52 -------------------- .github/workflows/poll_siblings_rebuild.yaml | 4 +- .github/workflows/tests_windows.yaml | 4 +- .github/workflows/weekly_pull_requests.yaml | 10 ---- 4 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/benchmark_phpunit.yaml diff --git a/.github/workflows/benchmark_phpunit.yaml b/.github/workflows/benchmark_phpunit.yaml deleted file mode 100644 index c510d82e0e1..00000000000 --- a/.github/workflows/benchmark_phpunit.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Benchmark PHPUnit - -# A/B wall-time benchmark: serial phpunit vs the fast-unit parallel runner. -# Scheduled only (not on pull requests); runs every 2 hours on ubuntu. -# Reminder: cron fires only from the default branch, so this starts running -# once the file is on `main`. -on: - schedule: - - cron: '0 */2 * * *' - workflow_dispatch: null - -env: - COMPOSER_ROOT_VERSION: "dev-main" - -jobs: - benchmark: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - php-versions: ['8.4', '8.5'] - - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - - name: benchmark (${{ matrix.os }}) - steps: - - uses: actions/checkout@v5 - - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - ini-values: zend.assertions=1 - - - uses: "ramsey/composer-install@v4" - - - name: Serial phpunit - shell: bash - run: | - printf '| platform | php | mode | wall time |\n| --- | --- | --- | --- |\n' >> "$GITHUB_STEP_SUMMARY" - start=$SECONDS - vendor/bin/phpunit - echo "| ${{ matrix.os }} | ${{ matrix.php-versions }} | serial | $((SECONDS - start))s |" >> "$GITHUB_STEP_SUMMARY" - - - name: fast-unit runner - shell: bash - run: | - start=$SECONDS - vendor/bin/fastunit - echo "| ${{ matrix.os }} | ${{ matrix.php-versions }} | fast-unit | $((SECONDS - start))s |" >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/poll_siblings_rebuild.yaml b/.github/workflows/poll_siblings_rebuild.yaml index 268fea91cb1..48a1af5261a 100644 --- a/.github/workflows/poll_siblings_rebuild.yaml +++ b/.github/workflows/poll_siblings_rebuild.yaml @@ -5,8 +5,8 @@ name: Poll Siblings And Rebuild on: schedule: - # every 15 min; GitHub floors scheduled runs at ~5 min and delays high-frequency crons - - cron: '*/15 * * * *' + # hourly backstop; the sibling merged-PR dispatch is the primary trigger + - cron: '0 * * * *' workflow_dispatch: null permissions: diff --git a/.github/workflows/tests_windows.yaml b/.github/workflows/tests_windows.yaml index 089b1edd2d1..a3a6de9e3ad 100644 --- a/.github/workflows/tests_windows.yaml +++ b/.github/workflows/tests_windows.yaml @@ -2,8 +2,8 @@ name: Tests (Windows) on: schedule: - # every 3 hours - - cron: '0 */3 * * *' + # daily + - cron: '0 0 * * *' workflow_dispatch: null diff --git a/.github/workflows/weekly_pull_requests.yaml b/.github/workflows/weekly_pull_requests.yaml index ea08b2ef43a..263ab0cf7cf 100644 --- a/.github/workflows/weekly_pull_requests.yaml +++ b/.github/workflows/weekly_pull_requests.yaml @@ -52,7 +52,6 @@ jobs: - name: Create pull-request uses: peter-evans/create-pull-request@v8 - id: cpr with: token: ${{ secrets.ACCESS_TOKEN }} commit-message: "[automated] ${{ matrix.actions.name }}" @@ -60,12 +59,3 @@ jobs: branch: ${{ matrix.actions.branch }} title: '[automated] ${{ matrix.actions.name }}' delete-branch: true - - - - name: Enable Pull Request Automerge - if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@v3 - with: - token: ${{ secrets.ACCESS_TOKEN }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash From 1de1eeb9315aea7982c556d296a1b71dc5a9937f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 11 Sep 2026 20:29:33 +0200 Subject: [PATCH 2/3] [CI] Run Windows tests every 6 hours instead of daily Claude-Session: https://claude.ai/code/session_01UMmvbzh8rGXtLypa1vCW1m --- .github/workflows/tests_windows.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_windows.yaml b/.github/workflows/tests_windows.yaml index a3a6de9e3ad..f2930ed72d0 100644 --- a/.github/workflows/tests_windows.yaml +++ b/.github/workflows/tests_windows.yaml @@ -2,8 +2,8 @@ name: Tests (Windows) on: schedule: - # daily - - cron: '0 0 * * *' + # every 6 hours + - cron: '0 */6 * * *' workflow_dispatch: null From 8db4379dd25fc95c7d5d056a69c94d43c0e5441d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 11 Sep 2026 20:31:21 +0200 Subject: [PATCH 3/3] [CI] Remove poll_siblings_rebuild backstop; sibling pull_request_target dispatch is reliable Claude-Session: https://claude.ai/code/session_01UMmvbzh8rGXtLypa1vCW1m --- .github/workflows/poll_siblings_rebuild.yaml | 65 -------------------- 1 file changed, 65 deletions(-) delete mode 100644 .github/workflows/poll_siblings_rebuild.yaml diff --git a/.github/workflows/poll_siblings_rebuild.yaml b/.github/workflows/poll_siblings_rebuild.yaml deleted file mode 100644 index 48a1af5261a..00000000000 --- a/.github/workflows/poll_siblings_rebuild.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Safety net for the event-driven dispatch_build_scoped_rector.yaml in each rector-* sibling. -# If a sibling's merged-PR dispatch is ever dropped, this cron notices the newer sibling main -# and re-runs build_scoped_rector.yaml. It is a backstop, not the primary trigger. -name: Poll Siblings And Rebuild - -on: - schedule: - # hourly backstop; the sibling merged-PR dispatch is the primary trigger - - cron: '0 * * * *' - workflow_dispatch: null - -permissions: - actions: write - -jobs: - poll_siblings_rebuild: - # only on the canonical repo, never forks - if: github.repository == 'rectorphp/rector-src' - - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - - name: "Rebuild if any sibling main is newer than the last scoped build" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - - SIBLINGS="rector-phpunit rector-doctrine rector-symfony rector-downgrade-php" - - # skip while rector-src main sits on a tagged release commit; the tag/empty-commit - # path is handled by the sibling dispatcher, not by this backstop - MAIN_SHA=$(gh api repos/rectorphp/rector-src/commits/main --jq '.sha') - if gh api repos/rectorphp/rector-src/tags --jq '.[].commit.sha' | grep -qx "$MAIN_SHA"; then - echo "rector-src main $MAIN_SHA is a tagged commit, skipping" - exit 0 - fi - - # start of the most recent build_scoped_rector run (any conclusion) - LAST_BUILD=$(gh api \ - repos/rectorphp/rector-src/actions/workflows/build_scoped_rector.yaml/runs \ - --jq '.workflow_runs[0].created_at // "1970-01-01T00:00:00Z"') - LAST_BUILD_TS=$(date -d "$LAST_BUILD" +%s) - echo "last scoped build: $LAST_BUILD" - - NEWER=0 - for SIB in $SIBLINGS; do - COMMIT_DATE=$(gh api "repos/rectorphp/$SIB/commits/main" --jq '.commit.committer.date') - COMMIT_TS=$(date -d "$COMMIT_DATE" +%s) - if [ "$COMMIT_TS" -gt "$LAST_BUILD_TS" ]; then - echo "$SIB main ($COMMIT_DATE) is newer than the last build" - NEWER=1 - else - echo "$SIB main ($COMMIT_DATE) already built" - fi - done - - if [ "$NEWER" -eq 1 ]; then - echo "Dispatching build_scoped_rector.yaml" - gh workflow run build_scoped_rector.yaml --repo rectorphp/rector-src --ref main - else - echo "All siblings already built, nothing to do" - fi