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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ env:
jobs:
# Runs the end-to-end test suite.
e2e-tests:
name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
name: ${{ matrix.label }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: As we don't use the label else where can we use label directly here?

Suggested change
name: ${{ matrix.label }}
name: E2E Tests
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a trick to get the UI in GitHub Actions to do what we want. A matrix value is needed in the name directive for proper grouping in the GitHub UI.

uses: ./.github/workflows/reusable-end-to-end-tests.yml
permissions:
contents: read
Expand All @@ -65,6 +65,7 @@ jobs:
fail-fast: false
matrix:
LOCAL_SCRIPT_DEBUG: [ true, false ]
label: [ 'E2E Tests' ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat trick! Just disappointing that it needs to be this way for the nesting to work properly.

It's not obvious at first glance why this is here. I'm thinking an inline comment above label briefly explaining why it's there would be good for our future selves.

with:
LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}

Expand Down
83 changes: 1 addition & 82 deletions .github/workflows/reusable-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
# - Uploads screenshots and HTML snapshots as an artifact.
# - Ensures version-controlled files are not modified or deleted.
e2e-tests:
name: Run E2E tests
name: SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
runs-on: ubuntu-24.04
permissions:
contents: read
Expand All @@ -74,84 +74,3 @@ jobs:
run: |
echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV"
echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV"

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
curl --version
git --version
locale -a

- name: Install npm Dependencies
run: npm ci

- name: Install Playwright browsers
if: ${{ inputs.install-playwright }}
run: npx playwright install --with-deps

- name: Build WordPress
run: npm run build

- name: Start Docker environment
run: |
npm run env:start

- name: Log running Docker containers
run: docker ps -a

- name: Docker debug information
run: |
docker -v
docker compose run --rm mysql mysql --version
docker compose run --rm php php --version
docker compose run --rm php php -m
docker compose run --rm php php -i
docker compose run --rm php locale -a

- name: Install WordPress
env:
LOCAL_SCRIPT_DEBUG: ${{ inputs.LOCAL_SCRIPT_DEBUG }}
run: npm run env:install

- name: Install Gutenberg
if: ${{ inputs.install-gutenberg }}
run: |
npm run env:cli -- plugin install gutenberg \
${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \
--path="/var/www/${LOCAL_DIR}"
env:
GUTENBERG_VERSION: ${{ inputs.gutenberg-version }}

- name: Install additional languages
run: |
npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}"
npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}"
npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}"

- name: Run E2E tests
run: npm run test:e2e

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: failures-artifacts${{ inputs.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}
path: artifacts
if-no-files-found: ignore
include-hidden-files: true

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code