From 92b2b82f8a5ee6973b9e6bb9a77a97df3935df25 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Tue, 27 Oct 2026 11:24:11 -0400 Subject: [PATCH 1/2] ci: speed up plugin workflows - Install Playwright's Chromium without --with-deps. The runner image already has its libraries, and the apt step has stalled for 10-40 minutes when the Ubuntu mirror is slow. - Check out without the example sites' uploads.zip files (590 MB of the 670 MB tree), and give detect jobs blobless full history instead of running git fetch --unshallow. - Drop the Stop wp-env step; the runner is discarded after the job. --- .github/scripts/get_plugin_slug.sh | 8 +++--- .github/workflows/code-quality.yml | 16 ++++++++++++ .github/workflows/codeception.yml | 16 ++++++++++++ .github/workflows/e2e-test.yml | 26 +++++++++++++++----- .github/workflows/plugin-artifact-for-pr.yml | 16 ++++++++++++ .github/workflows/plugin-check.yml | 16 ++++++++++++ 6 files changed, 89 insertions(+), 9 deletions(-) diff --git a/.github/scripts/get_plugin_slug.sh b/.github/scripts/get_plugin_slug.sh index 2035c0f12..bd36b617c 100644 --- a/.github/scripts/get_plugin_slug.sh +++ b/.github/scripts/get_plugin_slug.sh @@ -5,13 +5,15 @@ set -e BASE_SHA="$1" HEAD_SHA="$2" -git fetch --prune --unshallow 2>/dev/null || git fetch --prune +# Expects a checkout with fetch-depth: 0 and filter: blob:none, so the history is +# already here without file contents. --no-renames keeps git diff from fetching +# blobs for rename detection, and lists both the old and new path of a move. # Get changed files in plugins subdirectories if [ "$BASE_SHA" = "main" ]; then - CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/[^/]\+/' || true) + CHANGED_FILES=$(git diff --no-renames --name-only HEAD~1 HEAD | grep '^plugins/[^/]\+/' || true) else - CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true) + CHANGED_FILES=$(git diff --no-renames --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true) fi if [ -z "$CHANGED_FILES" ]; then diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ddcd46e2d..b4782594e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -28,6 +28,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history without file contents, for get_plugin_slug.sh's git diff. + fetch-depth: 0 + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Get changed plugin directory id: plugin @@ -83,6 +92,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: PHP Code Quality for ${{ matrix.plugin }} uses: ./.github/actions/code-quality diff --git a/.github/workflows/codeception.yml b/.github/workflows/codeception.yml index 4ed93c04c..810884d88 100644 --- a/.github/workflows/codeception.yml +++ b/.github/workflows/codeception.yml @@ -34,6 +34,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history without file contents, for get_plugin_slug.sh's git diff. + fetch-depth: 0 + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Get changed plugin directory id: plugin @@ -88,6 +97,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: ${{ matrix.plugin }} codeception tests uses: ./.github/actions/codeception with: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index fb25003a2..1336692e2 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -36,6 +36,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history without file contents, for get_plugin_slug.sh's git diff. + fetch-depth: 0 + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Get changed plugin directory id: plugin @@ -82,6 +91,13 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Setup Node.js uses: actions/setup-node@v4 @@ -104,8 +120,10 @@ jobs: composer-options: '--no-progress --optimize-autoloader --no-dev' - name: Install playwright browsers - # Use the locked @playwright/test, and only Chromium since that's all the config runs - run: pnpm exec playwright install --with-deps chromium + # Use the locked @playwright/test, and only Chromium since that's all the config runs. + # No --with-deps: the runner image already has Chromium's libraries, and the apt + # step it adds has stalled for 10-40 minutes when the Ubuntu mirror is slow. + run: pnpm exec playwright install chromium working-directory: plugins/${{ env.PLUGIN }} - name: Start wp-env @@ -116,7 +134,3 @@ jobs: - name: Run Playwright tests run: pnpm test:e2e working-directory: plugins/${{ env.PLUGIN }} - - - name: Stop wp-env - run: pnpm wp-env stop - working-directory: plugins/${{ env.PLUGIN }} diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 227fea6d8..a2ad8d964 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -18,6 +18,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history without file contents, for get_plugin_slug.sh's git diff. + fetch-depth: 0 + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Get changed plugin directories id: plugin @@ -39,6 +48,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Create plugin artifact for ${{ matrix.plugin }} uses: ./.github/actions/create-plugin-artifact diff --git a/.github/workflows/plugin-check.yml b/.github/workflows/plugin-check.yml index ec9f00e80..1cd51ec82 100644 --- a/.github/workflows/plugin-check.yml +++ b/.github/workflows/plugin-check.yml @@ -32,6 +32,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history without file contents, for get_plugin_slug.sh's git diff. + fetch-depth: 0 + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Get changed plugin directories id: plugin @@ -74,6 +83,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Skip the example sites' wp-env/uploads.zip files (~590 MB). Plugin jobs don't use them. + filter: blob:none + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !**/wp-env/uploads.zip - name: Setup PHP and install production dependencies uses: ./.github/actions/setup-php-composer From d97022af0fb33fe3463132affd5dfc7d9b8a7c1d Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Tue, 27 Oct 2026 11:24:38 -0400 Subject: [PATCH 2/2] test: touch hwp-previews to trigger plugin workflows (do not merge) --- .../src/Admin/Settings/Fields/Field/Abstract_Settings_Field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hwp-previews/src/Admin/Settings/Fields/Field/Abstract_Settings_Field.php b/plugins/hwp-previews/src/Admin/Settings/Fields/Field/Abstract_Settings_Field.php index 1f92b40fc..c1eaa5791 100644 --- a/plugins/hwp-previews/src/Admin/Settings/Fields/Field/Abstract_Settings_Field.php +++ b/plugins/hwp-previews/src/Admin/Settings/Fields/Field/Abstract_Settings_Field.php @@ -9,7 +9,7 @@ abstract class Abstract_Settings_Field implements Settings_Field_Interface { /** - * The settings field ID. + * The settings field ID (CI timing test). * * @var string */