Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/scripts/get_plugin_slug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ set -e
BASE_SHA="$1"
HEAD_SHA="$2"

git fetch --prune --unshallow 2>/dev/null || git fetch --prune
# The checkout's blobless history covers this diff, and --no-renames stops git from
# fetching blobs to detect renames.

# 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
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# get_plugin_slug.sh diffs against history, so fetch all of it without file contents.
fetch-depth: 0
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Get changed plugin directory
id: plugin
Expand Down Expand Up @@ -83,6 +92,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
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
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# get_plugin_slug.sh diffs against history, so fetch all of it without file contents.
fetch-depth: 0
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Get changed plugin directory
id: plugin
Expand Down Expand Up @@ -88,6 +97,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip
- name: ${{ matrix.plugin }} codeception tests
uses: ./.github/actions/codeception
with:
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# get_plugin_slug.sh diffs against history, so fetch all of it without file contents.
fetch-depth: 0
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Get changed plugin directory
id: plugin
Expand Down Expand Up @@ -82,6 +91,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -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.
# Skip --with-deps because the runner image has Chromium's libraries and its apt
# step has hung for up to 40 minutes.
run: pnpm exec playwright install chromium
working-directory: plugins/${{ env.PLUGIN }}

- name: Start wp-env
Expand All @@ -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 }}
16 changes: 16 additions & 0 deletions .github/workflows/plugin-artifact-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# get_plugin_slug.sh diffs against history, so fetch all of it without file contents.
fetch-depth: 0
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Get changed plugin directories
id: plugin
Expand All @@ -39,6 +48,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
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
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# get_plugin_slug.sh diffs against history, so fetch all of it without file contents.
fetch-depth: 0
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!**/wp-env/uploads.zip

- name: Get changed plugin directories
id: plugin
Expand Down Expand Up @@ -74,6 +83,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Skip the example sites' uploads.zip files (590 MB), which plugin jobs don't use.
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
Expand Down
Loading