CI/CD and workflow behavior
All workflows live under .github/workflows/. This page summarizes behavior; inline workflow comments and the workflows README are authoritative for details.
Pull requests (pr.yml)
Triggers: Every pull_request event.
Concurrency: One run per PR; newer commits cancel in-progress runs for that PR.
Typical steps:
- Labeler — Applies labels from
.github/labeler.ymlbased on changed paths. - Install — pnpm and Node (see workflow for versions),
pnpm install, rootcomposer install. - Lint — Full monorepo lint: PHP, JS, CSS, Markdown,
package.json. - Build —
npx nx affected --base="origin/<base_branch>" -t buildso only affected projects build. - Tests:
- Integration — PHP WordPress integration tests using wp-env.
- e2e — The
e2eproject from the shared Playwright config, running in the Playwright container with wp-env. - Screenshot — The
screenshotproject from the shared Playwright config, running visual regression tests against committed screenshots.- If a screenshot test fails, inspect the uploaded Playwright report artifact. To intentionally update baselines, run
npx nx run <project-name>:test-screenshot-generatefor the affected project.
- If a screenshot test fails, inspect the uploaded Playwright report artifact. To intentionally update baselines, run
- Artifacts — Playwright report uploaded on completion (unless cancelled).
How “affected” is chosen
The PR workflow compares the PR head to origin/<github.base_ref> (the target branch, usually main). Any project touched or implied by the Nx graph runs the expensive targets.
PR title (pr-title.yml)
The workflow checks whether a PR title follows Conventional Commits when a PR opens, changes, or is updated. Editing a title reruns this check without rerunning lint and tests. The check does not block merges until a repository admin configures the GitHub settings from DSWP-1264: enable squash merging only, set the squash commit message default to the PR title, and require Validate PR title in the main branch ruleset or protection settings. Until then, the check may report failure but is not a required merge gate. See the PR title cheat sheet.
Merges to main
- Docs: Pushes to
mainthat touchdocs/**, packagedocs/**, sync script, or docs workflow deploy the VitePress site viadeploy-docs.yml(see Documentation site). - Releases: Merging code does not by itself publish plugin/theme zip artifacts. A maintainer starts
tag.ymlfrom Actions. That workflow creates the tag.
Tags (tag.yml)
On the GitHub repository, navigate to Actions > Release Subproject and Update packages.json > Run workflow.
You do not type a version. The workflow reads existing {project}/v* tags and picks the next one.
Inputs:
- Use workflow from: the branch to release. A release from a branch other than
mainshould stay an alpha. Most releases run frommain. - Project to release: dropdown of monorepo projects. This list is hardcoded in
tag.yml(workflow_dispatch.inputs.name.options). When you rename a project, add the new Nx name here or you cannot cut a release. - Alpha: ticked by default. Leave it ticked for an alpha. Untick it for a real release.
How the next version is chosen:
- A project with no
{project}/v*tags starts at1.0.0-alpha.1(or1.0.0if Alpha is unticked). - Alphas count up on the same
X.Y.Z(1.0.0-alpha.1, then1.0.0-alpha.2). - Unticking Alpha ships that
X.Y.Zwhen it is not tagged yet. - After a real release, the next series is the next minor (
1.0.0→1.1.0or1.1.0-alpha.1). Patch and major are not bumped. - Tags that are not
X.Y.ZorX.Y.Z-alpha.N(for example1.1.0-a1) are ignored.
What this workflow does:
- Nx Release writes that version into the project's
package.jsonandCHANGELOG.md, commits those files, and tags{project}/v{version}(for examplebcew-blocks/v1.0.0-alpha.1). - Plugin PHP files and theme
style.cssin git are not edited. - Builds the project and creates a zip named
<project>-<version>.zip(for examplebcew-blocks-1.0.0-alpha.1.zip). The zip'sVersion:header is set to that version, including alphas. - Creates a GitHub Release from the changelog and attaches the zip. An alpha version is published as a prerelease.
- Updates
packages.jsonfor the Composer repository on GitHub Pages and deploys it.