From f8e6b20f43b5fad64dc6941348c18608720ed403 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 5 Apr 2026 10:14:20 +0100 Subject: [PATCH] chore: reduce CI matrix for PRs to prevent runner exhaustion (#7463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRs now run a minimal test matrix; full matrix runs on push to develop. Changes: - Backend tests: PRs test on Node 24 only (Linux). Windows tests only run on push to develop. Reduces from 12 to 2 jobs for PRs. - Upgrade-from-latest-release: PRs test on Node 24 only (1 job vs 3). - Frontend admin tests: PRs test on Node 24 only (1 job vs 3). This reduces PR CI from ~25 jobs to ~10, preventing runner exhaustion when multiple PRs are merged in succession. The full matrix (3 Node versions × Linux + Windows) still runs on every push to develop. Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/backend-tests.yml | 16 ++++++---------- .github/workflows/frontend-admin-tests.yml | 12 ++++++++++-- .github/workflows/frontend-tests.yml | 18 ++++++++++++++++-- .../workflows/upgrade-from-latest-release.yml | 9 ++------- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index e4facbff7..55ea64b90 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -27,7 +27,8 @@ jobs: strategy: fail-fast: false matrix: - node: [">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"] + # PRs: test on latest Node only. Push to develop: full matrix. + node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }} steps: - name: Checkout repository @@ -83,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - node: [">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"] + node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }} steps: - name: Checkout repository @@ -138,14 +139,12 @@ jobs: working-directory: src run: gnpm run test:vitest --runtimeVersion="${{ matrix.node }}" + # Windows tests only run on push to develop/master, not on PRs withoutpluginsWindows: env: PNPM_HOME: ~\\.pnpm-store - # run on pushes to any branch - # run on PRs from external forks if: | - (github.event_name != 'pull_request') - || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) + github.event_name != 'pull_request' strategy: fail-fast: false matrix: @@ -193,11 +192,8 @@ jobs: withpluginsWindows: env: PNPM_HOME: ~\\.pnpm-store - # run on pushes to any branch - # run on PRs from external forks if: | - (github.event_name != 'pull_request') - || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) + github.event_name != 'pull_request' strategy: fail-fast: false matrix: diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index 76bb45948..7123e22fc 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -21,7 +21,8 @@ jobs: strategy: fail-fast: false matrix: - node: [20, 22, 24] + # PRs: single Node version. Push: full matrix. + node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }} steps: - @@ -77,7 +78,7 @@ jobs: - name: Run the frontend admin tests shell: bash run: | - gnpm run prod --runtimeVersion="${{ matrix.node }}" & + gnpm run prod --runtimeVersion="${{ matrix.node }}" > /tmp/etherpad-server.log 2>&1 & connected=false can_connect() { curl -sSfo /dev/null http://localhost:9001/ || return 1 @@ -90,6 +91,13 @@ jobs: done cd src gnpm run test-admin --runtimeVersion="${{ matrix.node }}" + - name: Upload server log on failure + uses: actions/upload-artifact@v7 + if: failure() + with: + name: server-log-admin-${{ matrix.node }} + path: /tmp/etherpad-server.log + retention-days: 7 - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 9c8c4bf2e..da5ce0a3b 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -47,7 +47,7 @@ jobs: - name: Run the frontend tests shell: bash run: | - gnpm run prod & + gnpm run prod > /tmp/etherpad-server.log 2>&1 & connected=false can_connect() { curl -sSfo /dev/null http://localhost:9001/ || return 1 @@ -61,6 +61,13 @@ jobs: cd src gnpm exec playwright install chromium --with-deps gnpm run test-ui --project=chromium + - name: Upload server log on failure + uses: actions/upload-artifact@v7 + if: failure() + with: + name: server-log-chrome + path: /tmp/etherpad-server.log + retention-days: 7 - uses: actions/upload-artifact@v7 if: always() with: @@ -99,7 +106,7 @@ jobs: - name: Run the frontend tests shell: bash run: | - gnpm run prod & + gnpm run prod > /tmp/etherpad-server.log 2>&1 & connected=false can_connect() { curl -sSfo /dev/null http://localhost:9001/ || return 1 @@ -113,6 +120,13 @@ jobs: cd src gnpm exec playwright install firefox --with-deps gnpm run test-ui --project=firefox + - name: Upload server log on failure + uses: actions/upload-artifact@v7 + if: failure() + with: + name: server-log-firefox + path: /tmp/etherpad-server.log + retention-days: 7 - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/upgrade-from-latest-release.yml b/.github/workflows/upgrade-from-latest-release.yml index eb480c256..c60af163a 100644 --- a/.github/workflows/upgrade-from-latest-release.yml +++ b/.github/workflows/upgrade-from-latest-release.yml @@ -27,7 +27,8 @@ jobs: strategy: fail-fast: false matrix: - node: [20, 22, 24] + # PRs: single Node version. Push: full matrix. + node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }} steps: - name: Check out latest release @@ -56,12 +57,6 @@ jobs: with: packages: libreoffice libreoffice-pdfimport version: 1.0 - - - name: Install libreoffice - uses: awalsh128/cache-apt-pkgs-action@v1.6.0 - with: - packages: libreoffice libreoffice-pdfimport - version: 1.0 - name: Install all dependencies and symlink for ep_etherpad-lite run: gnpm install --frozen-lockfile --runtimeVersion="${{ matrix.node }}"