WordPress Core currently runs PHPUnit tests in two steps.
The first step checks out the WordPress repo, installs NPM, builds WP for use, and then zips everything to upload as an artifact on the workflow run. After that, individual jobs are created for various PHP/Memcached combinations to run the PHPUnit tests by downloading the previously built artifact. This prevents every job from needing to perform these steps.
However, the .git folder is not packaged and included in the artifact to save space (and it's no longer needed anyway).
When the test reporter submits results, it scans for .git and .svn directories to grab the commit message and revision number to associate the results with. In order for this to work successfully, the Git repo needs to be reconnected to the codebase (see Core revision 49786).
If the runner first checked for environment variables and fell back to searching for those directories as a second option, that information could be passed to the reporter without having to reestablish the directory as a Git repository.
WordPress Core currently runs PHPUnit tests in two steps.
The first step checks out the WordPress repo, installs NPM, builds WP for use, and then zips everything to upload as an artifact on the workflow run. After that, individual jobs are created for various PHP/Memcached combinations to run the PHPUnit tests by downloading the previously built artifact. This prevents every job from needing to perform these steps.
However, the
.git
folder is not packaged and included in the artifact to save space (and it's no longer needed anyway).When the test reporter submits results, it scans for
.git
and.svn
directories to grab the commit message and revision number to associate the results with. In order for this to work successfully, the Git repo needs to be reconnected to the codebase (see Core revision 49786).The GitHub Action runner provides this information through the
github
workflow context. In the case of apush
trigger event, the context would begithub.event.head_commit.message
(see https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads#push).If the runner first checked for environment variables and fell back to searching for those directories as a second option, that information could be passed to the reporter without having to reestablish the directory as a Git repository.