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
14 changes: 14 additions & 0 deletions .github/agent-ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ghcr.io/actions/actions-runner:latest

RUN sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
composer \
docker.io \
php-cli \
php-curl \
php-mbstring \
php-sqlite3 \
php-xml \
php-zip \
xz-utils \
&& sudo rm -rf /var/lib/apt/lists/*
52 changes: 36 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
- name: Ensure PHP toolchain
run: |
php -r "exit( version_compare( PHP_VERSION, '8.1', '>=' ) ? 0 : 1 );"
php -v
composer --version
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHP Unit tests
Expand All @@ -31,14 +32,30 @@ jobs:
with:
fetch-depth: 0
- id: changed-js
uses: dorny/paths-filter@v3
with:
filters: |
js:
- '**/*.js'
- '**/*.jsx'
- '**/*.mjs'
- '**/*.cjs'
name: Detect JS changes
run: |
if [ "${AGENT_CI_LOCAL:-}" = "true" ]; then
echo "js=true" >> "$GITHUB_OUTPUT"
exit 0
fi

base_ref="${GITHUB_BASE_REF:-}"
if [ -n "$base_ref" ]; then
git fetch --no-tags --depth=1 origin "$base_ref"
base="origin/$base_ref"
elif git rev-parse --verify HEAD^ >/dev/null 2>&1; then
base="HEAD^"
else
base="$(git rev-list --max-parents=0 HEAD)"
fi

merge_base="$(git merge-base "$base" HEAD 2>/dev/null || echo "$base")"

if git diff --name-only "$merge_base" HEAD | grep -Eq '\.(js|jsx|mjs|cjs)$'; then
echo "js=true" >> "$GITHUB_OUTPUT"
else
echo "js=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/setup-node@v4
if: steps.changed-js.outputs.js == 'true'
with:
Expand All @@ -59,6 +76,8 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.base_ref == 'main'
timeout-minutes: 20
env:
WP_ENV_CORE: WordPress/WordPress#7.0-branch
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -67,10 +86,11 @@ jobs:
cache: npm
- name: Install dependencies
run: npm ci
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
- name: Ensure PHP toolchain
run: |
php -r "exit( version_compare( PHP_VERSION, '8.1', '>=' ) ? 0 : 1 );"
php -v
composer --version
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run dist plugin standards check
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
.DS_Store
vendor/
dist/
dist/
.env.agent-ci
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ When writing or refactoring PHPUnit tests:
- Run the full PHPUnit suite when shared test support files (like `WordPressStubs.php`) are changed.
- Prefer assertions that verify integration calls and state transitions happened (for example submenu registration/removal and metadata checks).

## Local CI With Agent CI

- Install the `agent-ci` skill one time with `npx skills add redwoodjs/agent-ci --skill agent-ci`.
- Before completing substantial work, run `npm run ci:agent:ci` or `npm run ci:agent` and fix any failures before reporting the work as done.
- If Agent CI pauses on a failed step, fix the issue and resume with `npm run ci:agent:retry -- --name <runner-name>`.
- Keep local Agent CI secrets in `.env.agent-ci`. Never commit that file.

## Important Notes

- Asset files (`build/scripts/*.asset.php`) are auto-generated - never edit manually
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,35 @@ make test
make lint
make lint-changed
npm run plugin:check
npm run ci:agent:ci
npm run ci:agent
```

## Local GitHub Actions With Agent CI

ClawPress is set up to run its GitHub Actions workflows locally with [Agent CI](https://github.com/redwoodjs/agent-ci).

One-time agent skill setup:

```bash
npx skills add redwoodjs/agent-ci --skill agent-ci
```

Local workflow commands:

```bash
npm run ci:agent:ci
npm run ci:agent
npm run ci:agent:retry -- --name <runner-name>
```

Notes:

- Agent CI needs Docker available locally.
- The current `agent-ci` CLI release expects Node.js 22+ for these local runner commands.
- Local secrets belong in `.env.agent-ci` and should never be committed.
- `.github/agent-ci.Dockerfile` adds the extra tools this repo needs for local workflow runs, including Docker CLI access for `wp-env`.

## Key Features

### Admin Assistant MVP
Expand Down
2 changes: 1 addition & 1 deletion build/panel/panel.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-element', 'wp-i18n'), 'version' => '2c16ed003bf137db32ce');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-element', 'wp-i18n'), 'version' => 'fc1139b8633ce83d1ed5');
Loading
Loading