Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5e132e8
ci(github): add container support for self-hosted runners
dipankardas011 Mar 16, 2026
9f26544
ci: unify env vars and ports for self-hosted runners
dipankardas011 Mar 16, 2026
a3c68ff
fix(ci): add --yes flag to wp-env destroy commands
dipankardas011 Mar 16, 2026
a8a7ab8
fixed the --yes of wp-env destroy with --force
dipankardas011 Mar 16, 2026
872e914
added a pause for indepth analysis
dipankardas011 Mar 17, 2026
c5c2ca6
disabled spcific section to be able to check the workflow
dipankardas011 Mar 17, 2026
7b20fa0
ci: set WP_ENV_HOME for isolated wp-env data
dipankardas011 Mar 17, 2026
9d1939f
ci(github): increase timeouts and fix safe.directory
dipankardas011 Mar 17, 2026
2686cfd
feat(ci): use dynamic outputs for job filtering
dipankardas011 Mar 17, 2026
572203c
ci: fix permission denied errors for test artifacts
dipankardas011 Mar 17, 2026
ac888b5
dbg: e2e test suite
dipankardas011 Mar 18, 2026
681607d
test(e2e): path for the npx
dipankardas011 Mar 18, 2026
58522b2
ci(e2e): giving it the wp-env test one
dipankardas011 Mar 18, 2026
aa57089
ci(e2e): disable Playwright webServer and clean env usage
dipankardas011 Mar 18, 2026
1363a77
feat(ci): set WP_BASE_URL for E2E tests in workflow
dipankardas011 Mar 18, 2026
3207149
ci(e2e): support host.docker.internal in e2e workflow
dipankardas011 Mar 18, 2026
3886236
feat(ci): improve Playwright network reliability in e2e workflow
dipankardas011 Mar 18, 2026
d9fc1de
feat(ci): enhance E2E reliability with socat proxy
dipankardas011 Mar 18, 2026
1e4d74e
feat(test): enable headless mode in Playwright config
dipankardas011 Mar 18, 2026
ff4a7a0
chore(e2e): remove debug flag and extend base config
dipankardas011 Mar 18, 2026
b457253
feat(ci): enable dynamic outputs and e2e job triggers
dipankardas011 Mar 18, 2026
2830f52
Apply suggestion from @dipankardas011
dipankardas011 Mar 18, 2026
790da09
ci: improve CI blueprint and Playwright config
dipankardas011 Mar 19, 2026
08be4c7
ci: update workflow dependencies and permissions
dipankardas011 Mar 19, 2026
752952b
ci(playground): add GitHub CLI install to PR preview workflow
dipankardas011 Mar 19, 2026
30511ec
ci: simplify workflows and update test commands
dipankardas011 Mar 19, 2026
cafed50
ci(github): fix PATH for sudo -u wpuser npm commands
dipankardas011 Mar 19, 2026
8117a4b
Revert "ci(github): fix PATH for sudo -u wpuser npm commands"
dipankardas011 Mar 19, 2026
c7e7ecf
ci(github): add npm to PATH for wpuser in workflows
dipankardas011 Mar 19, 2026
a244705
reverted the sudo -E to bring the system back to stability
dipankardas011 Mar 19, 2026
519a055
Merge branch 'main' into ci/self-hosting
justlevine Mar 19, 2026
cef424a
ci: restore public workflows
justlevine Mar 19, 2026
ae8ebf8
ci: Remove unnecessary release-public.yml
justlevine Mar 19, 2026
4ba109a
ci: docs and cleanup
justlevine Mar 19, 2026
b33e523
ci: Fix run id
justlevine Mar 19, 2026
c2a226f
ci: trigger on workflow changes
justlevine Mar 19, 2026
3e80ff6
ci: stop using TESTS_PORT (first pass)
justlevine Mar 19, 2026
368222d
ci: remove activate plugin step
justlevine Mar 19, 2026
dbd3bcf
Merge branch 'main' into ci/self-hosting
justlevine Mar 19, 2026
116073b
ci: more wp-env 11 fixes
justlevine Mar 20, 2026
8bfb2e3
Merge branch 'main' into ci/self-hosting
justlevine Mar 20, 2026
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
40 changes: 19 additions & 21 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ Workflows are defined to be reusable and modular.

Main CI pipeline used to validate code. Based on file changes it calls the following reusable workflows:

| Reusable Workflow | What |
| --------------------------------------- | ----------------------------------------- |
| `reusable-phpcs.yml` | PHPCS linting |
| `reusable-phpstan.yml` | PHPStan static analysis |
| `reusable-phpunit.yml` | PHPUnit tests |
| `reusable-lint-css-js.yml` | ESlint, Stylelint, Prettier, tsc linting |
| `reusable-jest.yml` | Jest tests |
| `reusable-e2e.yml` | Playwright end-to-end tests |
| `reusable-build.yml` | Creates a build zip (used by playground) |
| `reusable-wp-playground-pr-preview.yml` | PR preview environment with wp-playground |

### `copilot-setup-steps.yml`
| Reusable Workflow | What |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| [`reusable-phpcs.yml`](.reusable-phpcs.yml) <br /> [`reusable-phpcs-public.yml`](.reusable-phpcs-public.yml) | PHPCS linting |
| [`reusable-phpstan.yml`](.reusable-phpstan.yml) <br /> [`reusable-phpstan-public.yml`](.reusable-phpstan-public.yml) | PHPStan static analysis |
| [`reusable-phpunit.yml`](.reusable-phpunit.yml) <br /> [`reusable-phpunit-public.yml`](.reusable-phpunit-public.yml) | PHPUnit tests |
| [`reusable-lint-css-js.yml`](.reusable-lint-css-js.yml) <br /> [`reusable-lint-css-js-public.yml`](.reusable-lint-css-js-public.yml) | ESlint, Stylelint, Prettier, tsc linting |
| [`reusable-jest.yml`](.reusable-jest.yml) <br /> [`reusable-jest-public.yml`](.reusable-jest-public.yml) | Jest tests |
| [`reusable-e2e.yml`](.reusable-e2e.yml) <br /> [`reusable-e2e-public.yml`](.reusable-e2e-public.yml) | Playwright end-to-end tests |
| [`reusable-build.yml`](.reusable-build.yml) <br /> [`reusable-build-public.yml`](.reusable-build-public.yml) | Creates a build zip (used by playground) |
| [`reusable-wp-playground-pr-preview.yml`](.reusable-wp-playground-pr-preview.yml) <br /> [`reusable-wp-playground-pr-preview-public.yml`](.reusable-wp-playground-pr-preview-public.yml) | PR preview environment with wp-playground |

Reusable workflows have a `-public` variant which is used for public GitHub runners. The non-public variants are used for rtCamp's private runners. Ensure that `ci.yml` points to the correct workflows you need, and delete the others.

### [`copilot-setup-steps.yml`](copilot-setup-steps.yml)

Sets up dev environment for GitHub Copilot coding agent.

### `pr-title.yml`
### [`pr-title.yml`](pr-title.yml)

Triggers on PRs. Validates [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format, required for release-please automation.

### `release.yml`
### [`release.yml`](release.yml)

Triggers on push to `main`. Uses [release-please](https://github.com/googleapis/release-please) to automate releases based on conventional commits.

Expand All @@ -38,9 +40,9 @@ When a release is created, it builds the plugin via `reusable-build.yml` and upl

### Secrets

| Secret | Required By | Notes |
| --------------- | ------------------------------------------- | ---------------------------------------------------- |
| `CODECOV_TOKEN` | `reusable-phpunit.yml`, `reusable-jest.yml` | Optional — coverage uploads fail silently without it |
| Secret | Required By | Notes |
| --------------- | -------------------------------------------------------------- | ---------------------------------------------------- |
| `CODECOV_TOKEN` | `reusable-phpunit-public.yml` <br />`reusable-jest-public.yml` | Optional — coverage uploads fail silently without it |

### PR Previews

Expand Down Expand Up @@ -72,7 +74,3 @@ act workflow_dispatch \
-s GITHUB_TOKEN=your_github_token_here \
-P ubuntu-24.04=catthehacker/ubuntu:act-latest
```

## Private Runners

@todo
52 changes: 39 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

permissions: {}
permissions:
contents: read

jobs:
detect:
name: Detect Changes
runs-on: ubuntu-24.04
# Use `ubuntu-24.04` on public repositories.
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
permissions:
contents: read
Expand All @@ -38,8 +40,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# Comment this out on private repositories to allow sharing of credentials with subsequent jobs.
# with:
# persist-credentials: false

- name: Detect file changes
uses: dorny/paths-filter@9d7afb8d214ad99e78fbd4247752c4caed2b6e4c # v4.0.0
Expand All @@ -50,17 +53,24 @@ jobs:
- '**.php'
- 'composer.*'
phpcs:
- '.phpcs.xml.dist'
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-phpcs.yml'
- '.phpcs.xml.dist'
phpstan:
- 'phpstan.neon.dist'
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-phpstan.yml'
- 'phpstan.neon.dist'
phpunit:
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-phpunit.yml'
- 'tests/**/*.php'
- 'phpunit.xml.dist'
- '.github/workflows/reusable-phpunit.yml'
- 'package*.json'
- '.wp-env.test.json'
js:
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-lint-css-js.yml'
- '.nvmrc'
- '**.cjs'
- '**.js'
- '**.jsx'
Expand All @@ -70,32 +80,38 @@ jobs:
- '**.ts'
- '**.tsx'
- 'package*.json'
- '.eslintrc*'
- 'tsconfig*.json'
css:
- '**.css'
- '**.scss'
- '.editorconfig'
- '.browserslistrc'
- '.stylelintignore'
- '.stylelintrc*'
- '.stylelint.config.js'
e2e:
- 'tests/e2e/**/*'
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-e2e.yml'
- 'tests/e2e/**/*'
- 'playwright.config.ts'
jest:
- '.github/workflows/ci.yml'
- '.github/workflows/reusable-jest.yml'
- 'tests/js/**/*'
- 'src/**/__tests__/**/*'
- 'src/**/*.test.ts'
- 'src/**/*.test.tsx'
- 'src/**/*.spec.ts'
- 'src/**/*.spec.tsx'
- 'jest.config.js'
- '.github/workflows/reusable-jest.yml'
- 'package*.json'
- '.wp-env.test.json'
phpcs:
name: PHPCS
needs: detect
if: needs.detect.outputs.php == 'true' || needs.detect.outputs.phpcs == 'true'
uses: ./.github/workflows/reusable-phpcs.yml
# uses: ./.github/workflows/reusable-phpcs-public.yml
permissions:
contents: read
with:
Expand All @@ -106,6 +122,7 @@ jobs:
needs: detect
if: needs.detect.outputs.php == 'true' || needs.detect.outputs.phpstan == 'true'
uses: ./.github/workflows/reusable-phpstan.yml
# uses: ./.github/workflows/reusable-phpstan-public.yml
permissions:
contents: read
with:
Expand All @@ -116,6 +133,7 @@ jobs:
needs: detect
if: needs.detect.outputs.css == 'true' || needs.detect.outputs.js == 'true'
uses: ./.github/workflows/reusable-lint-css-js.yml
# uses: ./.github/workflows/reusable-lint-css-js-public.yml
permissions:
contents: read

Expand All @@ -124,20 +142,24 @@ jobs:
needs: detect
if: needs.detect.outputs.js == 'true' || needs.detect.outputs.jest == 'true'
uses: ./.github/workflows/reusable-jest.yml
# uses: ./.github/workflows/reusable-jest-public.yml
permissions:
contents: read
with:
coverage: true

phpunit:
name: PHPUnit (PHP ${{ matrix.php }}, WP ${{ matrix.wp }})
needs: detect
needs: [detect, build-plugin-zip]
if: needs.detect.outputs.php == 'true' || needs.detect.outputs.phpunit == 'true'
uses: ./.github/workflows/reusable-phpunit.yml
# uses: ./.github/workflows/reusable-phpunit-public.yml
permissions:
contents: read
strategy:
fail-fast: false
# Uncomment this on private runners, which can't run multiple wp-env instances in parallel.
max-parallel: 1
matrix:
php: ['8.4', '8.3', '8.2']
wp: ['latest']
Expand All @@ -153,9 +175,11 @@ jobs:

e2e:
name: E2E Tests
needs: detect
# needs: detect
needs: phpunit
if: needs.detect.outputs.php == 'true' || needs.detect.outputs.e2e == 'true' || needs.detect.outputs.js == 'true' || needs.detect.outputs.css == 'true'
uses: ./.github/workflows/reusable-e2e.yml
# uses: ./.github/workflows/reusable-e2e-public.yml
permissions:
contents: read
with:
Expand All @@ -166,6 +190,7 @@ jobs:
permissions:
contents: read
uses: ./.github/workflows/reusable-build.yml
# uses: ./.github/workflows/reusable-build-public.yml
with:
php-version: '8.2'
artifact-name: plugin-skeleton-d-pr${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
Expand All @@ -176,6 +201,7 @@ jobs:
needs: build-plugin-zip
if: github.event_name == 'pull_request'
uses: ./.github/workflows/reusable-wp-playground-pr-preview.yml
# uses: ./.github/workflows/reusable-wp-playground-pr-preview-public.yml
permissions:
actions: read
contents: write
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/reusable-build-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Reusable Build

on:
workflow_call:
inputs:
php-version:
required: true
type: string
artifact-name:
required: true
type: string

jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
with:
php-version: ${{ inputs.php-version }}
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@a35c6ebd3d08125aaf8852dff361e686a1a67947 # v3.2.0
with:
composer-options: '--no-dev --optimize-autoloader'

- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install npm dependencies
run: npm ci

- name: Build plugin for release
run: npm run build:prod

- name: Start the Docker testing environment
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 10
max_attempts: 3
command: npm run wp-env start

- name: Generate Translation files
run: npm run i18n:make-pot

- name: Create plugin zip
run: npm run plugin-zip

- name: Upload plugin zip artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ inputs.artifact-name }}
path: plugin-skeleton-d.zip
if-no-files-found: error
Loading
Loading