Skip to content
Open
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
2 changes: 0 additions & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
.nvmrc
.phpunit.result.cache
composer.lock
docker-compose.build.yml
docker-compose.yml
Gruntfile.js
connectors.md
package.json
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/docker-images.yml

This file was deleted.

73 changes: 9 additions & 64 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
lint:
name: Lint and Test
runs-on: ubuntu-22.04
timeout-minutes: 10
timeout-minutes: 20
permissions:
contents: read
packages: read
Expand Down Expand Up @@ -45,13 +45,6 @@ jobs:
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM dependencies
run: npm install

Expand All @@ -64,16 +57,16 @@ jobs:
- name: Build
run: npm run build

- name: Pull custom Docker images
run: docker compose pull wordpress
- name: Start wp-env

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Leftovers now that GHCR and Compose are gone:

  • WORDPRESS_IMAGE_VERSION: php8.2 (line 9) no longer has a consumer — PHP is pinned by phpVersion in .wp-env.json, and wp-env's env override is WP_ENV_PHP_VERSION (which switch-to:php* uses).
  • packages: read (lines 19 and 73) was only needed for the ghcr.io login this PR removes.

Both are harmless, just dead config worth clearing while this file is already being touched.

run: npx wp-env start

- name: Test
run: npm run test

e2e:
name: E2E
runs-on: ubuntu-22.04
timeout-minutes: 12
timeout-minutes: 15
needs: lint
permissions:
contents: read
Expand Down Expand Up @@ -106,16 +99,6 @@ jobs:
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

- name: Map stream.wpenv.net to localhost
run: echo "127.0.0.1 stream.wpenv.net" | sudo tee -a /etc/hosts

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM dependencies
run: npm install

Expand All @@ -136,55 +119,17 @@ jobs:
- name: Build
run: npm run build

- name: Pull custom Docker images
# `--ignore-pull-failures` so the first push of this branch (before
# docker-images.yml has published ghcr.io/xwp/stream-mkcert) still
# passes CI. Docker Compose then falls back to the local build:
# context for any image it couldn't pull, keeping the workflow
# green while a master push backfills the registry.
run: docker compose pull --ignore-pull-failures wordpress mkcert

- name: Rebuild WordPress image on top of the pulled base
# The published ghcr.io/xwp/stream-wordpress image is updated only by
# docker-images.yml on master pushes. When this branch changes
# local/docker/wordpress/Dockerfile (e.g. to enable mod_ssl), the
# pulled image lags behind the branch's intent and Apache rejects
# :443 with ERR_CONNECTION_CLOSED. Build locally so the branch's
# Dockerfile actually applies; Docker layer caching keeps this cheap
# when the Dockerfile hasn't changed since the last published build.
run: docker compose build wordpress

- name: Start WordPress
run: npm run start

- name: Wait for MySQL (from inside the wordpress container)
run: |
npm run cli -- php -r '
require "/var/www/html/wp-content/plugins/stream-src/vendor/autoload.php";
( new XWP\Wait_For\Tcp_Connection( "mysql", 3306 ) )->connect( 120 );
echo "MySQL is accepting connections on mysql:3306.\n";
'

- name: Wait for WordPress (from the runner)
run: |
php -r '
require "vendor/autoload.php";
( new XWP\Wait_For\Tcp_Connection( "127.0.0.1", 443 ) )->connect( 60 );
echo "WordPress is accepting HTTPS connections on 127.0.0.1:443.\n";
'

- name: Install WordPress multisite
run: npm run install-wordpress
- name: Start wp-env
run: npx wp-env start

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

- name: Dump container state on failure
- name: Dump wp-env logs on failure
if: failure()
run: |
docker compose ps || true
docker compose logs --tail=80 mysql || true
docker compose logs --tail=80 wordpress || true
npx wp-env logs || true
npx wp-env logs tests || true

- name: Upload Playwright report
if: ${{ !cancelled() }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ debug.log
package.lock
.phpunit.result.cache
.phpunit.cache/
.wp-env.override.json

# Locally-generated TLS cert + key for the dev environment HTTPS vhost.
# Created by local/scripts/setup-https.sh via mkcert.
# Locally-generated TLS cert + key (legacy compose HTTPS; unused by wp-env).
/local/certs/

# Generated test data
Expand Down
5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"vendor/"
],
"pathMappings": {
"/var/www/html/wp-content/plugins/stream-src": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/stream": "${workspaceFolder}/build",
"/var/www/html": "${workspaceFolder}/local/public"
"/var/www/html/wp-content/plugins/stream": "${workspaceFolder}",
"/var/www/html": "${workspaceFolder}/local/public/wp"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wp-env doesn't serve core from local/public/wp — that path is the Composer (roots/wordpress) install from extra.wordpress-install-dir. The container's /var/www/html is wp-env's own WordPress under ~/.wp-env/<hash>/WordPress.

As written, Xdebug maps container core files onto a different WordPress copy, so stepping into core lands in files that only coincidentally match. The plugin mapping on line 13 is the one that matters here; I'd drop this entry (or point it at the wp-env directory).

}
}
]
Expand Down
30 changes: 30 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"phpVersion": "8.2",
"plugins": [".", "https://make.wordpress.org/test/files/2026/02/wp-email-logger.zip"],
"multisite": true,
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"SCRIPT_DEBUG": true
},
"lifecycleScripts": {
"afterStart": "wp-env run cli -- wp plugin activate stream wp-email-logger --network"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wp plugin activate stream assumes the plugin is mounted at wp-content/plugins/stream, but wp-env derives that name from the checkout directory, not the plugin slug. For a local source like ".", packages/env/lib/config/parse-source-string.js does const basename = path.basename( sourcePath ).

So a clone into stream-plugin/, stream-wp/, stream-2/, etc. mounts at wp-content/plugins/<dir name> and then:

  • this afterStart script fails (stream is not installed),
  • --env-cwd=wp-content/plugins/stream in the test:* scripts fails,
  • the launch.json path mapping silently stops matching.

CI is unaffected (checkout dir = repo name), so this is a contributor sharp edge. Either resolve the directory name dynamically or document in contributing.md that the clone must be named stream.

},
"env": {
"development": {
"phpmyadminPort": 9001
},
"tests": {
"plugins": [".", "https://make.wordpress.org/test/files/2026/02/wp-email-logger.zip"],
"mappings": {
"wp-content/plugins/advanced-custom-fields": "./local/public/wp-content/plugins/advanced-custom-fields",
"wp-content/plugins/easy-digital-downloads": "./local/public/wp-content/plugins/easy-digital-downloads",
"wp-content/plugins/jetpack": "./local/public/wp-content/plugins/jetpack",
"wp-content/plugins/user-switching": "./local/public/wp-content/plugins/user-switching",
"wp-content/plugins/wordpress-seo": "./local/public/wp-content/plugins/wordpress-seo",
"wp-content/plugins/two-factor": "./local/public/wp-content/plugins/two-factor",
"wp-content/mu-plugins/mercator": "./local/public/wp-content/mu-plugins/mercator"
}
}
}
}
Loading
Loading