Skip to content
Merged
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
50 changes: 0 additions & 50 deletions .distignore

This file was deleted.

78 changes: 32 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

# PR gate: all four jobs run natively on ubuntu-24.04 — no Docker, no make.
# PHP 7.4 / WP 7.0 on PRs guards the plugin's hard PHP 7.4 compatibility requirement.
# PR gate: PHPCS, PHPUnit, and Plugin Check run on ubuntu-24.04 via wp-env.
# E2E tests run only on release/* branches — see pre-release.yml.

on:
pull_request:
Expand All @@ -19,65 +19,51 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up toolchain
run: sh scripts/setup/unit.sh
env:
PHP_VERSION: '7.4'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- name: Start WordPress environment
run: npm run wp-env:start
- name: Run PHPCS
run: sh scripts/tests/lint.sh
run: npm run lint
- name: Stop WordPress environment
if: always()
run: npm run wp-env:stop

unit:
name: PHPUnit
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up toolchain
run: sh scripts/setup/unit.sh
env:
PHP_VERSION: '7.4'
- name: Run PHPUnit
run: sh scripts/tests/unit.sh

test-e2e:
name: Functional E2E
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up e2e environment
run: sh scripts/setup/e2e.sh
env:
PHP_VERSION: '7.4'
WP_VERSION: '7.0'
- name: Run functional e2e suite
run: sh scripts/tests/e2e.sh
env:
PHP_VERSION: '7.4'
WP_VERSION: '7.0'
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@v4
- uses: actions/setup-node@v4
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 7
node-version: '20'
cache: npm
- run: npm ci
- name: Start WordPress environment
run: npm run wp-env:start
- name: Run PHPUnit
run: npm run test:unit
- name: Stop WordPress environment
if: always()
run: npm run wp-env:stop

check-plugin:
name: Plugin Check (PCP)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up e2e environment
run: sh scripts/setup/e2e.sh
env:
PHP_VERSION: '7.4'
WP_VERSION: '7.0'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- name: Build distributable zip
run: npm run build:zip
- name: Run Plugin Check suite
run: sh scripts/tests/plugin-check.sh
env:
PHP_VERSION: '7.4'
WP_VERSION: '7.0'
run: npm run plugin-check
- name: Post Plugin Check results as PR comment
if: always() && github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
Expand Down
113 changes: 66 additions & 47 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: Pre-release

# Full PHP × WP matrix sweep.
# Full WP version matrix sweep. PHP fixed at 8.3 (set in .wp-env.json).
# Triggers automatically on release/* PRs to main; also runnable manually.

on:
workflow_dispatch:
inputs:
php_version:
description: 'PHP version to test, or "all"'
default: 'all'
wp_version:
description: 'WP version to test, or "all"'
default: 'all'
Expand All @@ -21,98 +18,120 @@ jobs:
runs-on: ubuntu-24.04
if: startsWith(github.head_ref, 'release/') || github.event_name == 'workflow_dispatch'
outputs:
php: ${{ steps.set.outputs.php }}
wp: ${{ steps.set.outputs.wp }}
steps:
- id: set
run: |
if [ -z "${{ inputs.php_version }}" ] || [ "${{ inputs.php_version }}" = "all" ]; then
echo 'php=["7.4","8.0","8.1","8.2","8.3"]' >> $GITHUB_OUTPUT
else
echo 'php=["${{ inputs.php_version }}"]' >> $GITHUB_OUTPUT
fi
if [ -z "${{ inputs.wp_version }}" ] || [ "${{ inputs.wp_version }}" = "all" ]; then
echo 'wp=["6.8","6.9","7.0"]' >> $GITHUB_OUTPUT
else
echo 'wp=["${{ inputs.wp_version }}"]' >> $GITHUB_OUTPUT
fi

lint:
name: PHPCS (PHP 8.3)
name: PHPCS
runs-on: ubuntu-24.04
if: startsWith(github.head_ref, 'release/') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- run: sh scripts/setup/unit.sh
env:
PHP_VERSION: '8.3'
- run: sh scripts/tests/lint.sh
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- run: npm run wp-env:start
- run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/airo-wp -- composer install --no-interaction --no-progress
- run: npm run lint
- if: always()
run: npm run wp-env:stop

unit:
name: PHPUnit (PHP ${{ matrix.php }})
needs: matrix-setup
name: PHPUnit
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.matrix-setup.outputs.php) }}
if: startsWith(github.head_ref, 'release/') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- run: sh scripts/setup/unit.sh
env:
PHP_VERSION: ${{ matrix.php }}
- run: sh scripts/tests/unit.sh
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- run: npm run wp-env:start
- run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/airo-wp -- composer install --no-interaction --no-progress
- run: npm run test:unit
- if: always()
run: npm run wp-env:stop

test-e2e:
name: E2E (PHP ${{ matrix.php }} × WP ${{ matrix.wp }})
name: E2E (WP ${{ matrix.wp }})
needs: matrix-setup
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.matrix-setup.outputs.php) }}
wp: ${{ fromJson(needs.matrix-setup.outputs.wp) }}
steps:
- uses: actions/checkout@v4
- run: sh scripts/setup/e2e.sh
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp }}
- run: sh scripts/tests/e2e.sh
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp }}
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- name: Pin WP version in .wp-env.json
run: |
node -e "
const fs = require('fs');
const cfg = JSON.parse(fs.readFileSync('.wp-env.json','utf8'));
cfg.core = 'https://wordpress.org/wordpress-${{ matrix.wp }}.zip';
fs.writeFileSync('.wp-env.json', JSON.stringify(cfg, null, 2));
"
- run: npm run build
- run: npm run wp-env:start
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
- if: always()
run: npm run wp-env:stop
- if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-php${{ matrix.php }}-wp${{ matrix.wp }}
name: playwright-report-wp${{ matrix.wp }}
path: |
playwright-report/
test-results/
retention-days: 7

check-plugin:
name: Plugin Check (PHP ${{ matrix.php }} × WP ${{ matrix.wp }})
name: Plugin Check (WP ${{ matrix.wp }})
needs: matrix-setup
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.matrix-setup.outputs.php) }}
wp: ${{ fromJson(needs.matrix-setup.outputs.wp) }}
steps:
- uses: actions/checkout@v4
- run: sh scripts/setup/e2e.sh
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp }}
- run: sh scripts/tests/plugin-check.sh
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp }}
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- name: Pin WP version in .wp-env.json
run: |
node -e "
const fs = require('fs');
const cfg = JSON.parse(fs.readFileSync('.wp-env.json','utf8'));
cfg.core = 'https://wordpress.org/wordpress-${{ matrix.wp }}.zip';
fs.writeFileSync('.wp-env.json', JSON.stringify(cfg, null, 2));
"
- run: npm run wp-env:start
- run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/airo-wp -- composer install --no-dev --no-interaction --no-progress
- run: npm run build:zip
- run: npm run plugin-check
- if: always()
run: npm run wp-env:stop
- if: failure()
uses: actions/upload-artifact@v4
with:
name: plugin-check-php${{ matrix.php }}-wp${{ matrix.wp }}
name: plugin-check-wp${{ matrix.wp }}
path: builds/plugin-check-results.txt
retention-days: 7
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
# DSG-owned — generated by make dsg-sync, never edited directly and not committed.
# Regenerated by make dsg-sync; shipped to the zip via the package.json "files"
# allowlist (build-zip.sh runs sync + build), so they don't need to be tracked.
/.env.local
/artifacts/storage-states/*.json
Loading
Loading