Skip to content

fix(ci): keep wp-env files in the runner work directory - #76

Closed
rtBot wants to merge 1 commit into
mainfrom
fix/wp-env-home-in-runner-temp
Closed

rtBot wants to merge 1 commit into
mainfrom
fix/wp-env-home-in-runner-temp

Conversation

@rtBot

@rtBot rtBot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Why

On the self-hosted ARC runners, wp-env jobs start WordPress but PHPUnit fails to bootstrap (orion run, 14 of 29 jobs):

Failed opening required '/wordpress-phpunit/includes/functions.php'

wp-env downloads WordPress core and the PHPUnit test library into WP_ENV_HOME (default ~/.wp-env, which is /home/runner/.wp-env) and bind-mounts them into its containers. On ARC, the Docker daemon runs in a separate dind container that shares only /home/runner/_work with the runner. A mount from ~ therefore resolves to an empty directory on the daemon's side:

  • /wordpress-phpunit is empty, so PHPUnit fails.
  • The core directory is empty too. The wordpress image then copies in its own bundled core, so the wp-version input is silently ignored on these runners.

I confirmed this on a runner pod. A file written under ~ is missing inside docker run -v, and the same file under _work is present.

What

ci-test-php, ci-test-a11y and ci-test-build-artifact now set WP_ENV_HOME=$RUNNER_TEMP/wp-env before Start wp-env. RUNNER_TEMP is inside the work directory on every runner type (/home/runner/_work/_temp on ARC), so the daemon sees the same files. On GitHub-hosted runners nothing changes except where wp-env stores its cache.

RUNNER_TEMP is set by the runner, not by user input, so writing it to $GITHUB_ENV is not injectable.

Note

Consumers pin @v1, so the fix reaches them once it is released and v1 is moved.

Refs rtCamp/support#1510

wp-env stores WordPress core and the PHPUnit test library under WP_ENV_HOME
(default ~/.wp-env) and bind-mounts them into its containers. On ARC runners
the Docker daemon runs in a dind sidecar that shares only the work directory,
so those mounts are empty and PHPUnit fails with "Failed opening required
'/wordpress-phpunit/includes/functions.php'". Point WP_ENV_HOME at
$RUNNER_TEMP/wp-env, which is inside the work directory on every runner type.

Refs rtCamp/support#1510
@rtBot

rtBot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing. Repositories that run wp-env on the self-hosted ARC runners set WP_ENV_HOME in their own workflow, as rt-migration, icimod and wp-editorial-library already do. Details in rtCamp/support#1510.

@rtBot rtBot closed this Nov 26, 2026
@rtBot
rtBot deleted the fix/wp-env-home-in-runner-temp branch November 26, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants