Skip to content

Commit 98e801f

Browse files
committed
moved to github actions
1 parent a6d75c5 commit 98e801f

4 files changed

Lines changed: 97 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [develop, main]
7+
8+
jobs:
9+
phpunit:
10+
name: PHP ${{ matrix.php }} / WP ${{ matrix.wp }} / Multisite ${{ matrix.multisite }}
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
mysql:
15+
image: mysql:8.0
16+
env:
17+
MYSQL_ROOT_PASSWORD: password
18+
MYSQL_DATABASE: wordpress_test
19+
ports:
20+
- 3306:3306
21+
options: >-
22+
--health-cmd="mysqladmin ping"
23+
--health-interval=10s
24+
--health-timeout=5s
25+
--health-retries=3
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
31+
wp: ['6.3', '6.4', '6.5', 'trunk']
32+
multisite: [0, 1]
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php }}
40+
extensions: mysqli
41+
coverage: none
42+
43+
- name: Install Composer dependencies
44+
run: composer install --no-interaction --prefer-dist
45+
46+
- name: Install WordPress
47+
env:
48+
WP_VERSION: ${{ matrix.wp }}
49+
run: bash bin/install-wp-core.sh
50+
51+
- name: Run PHPUnit
52+
env:
53+
WP_DEVELOP_DIR: ./tmp/wordpress/
54+
WP_MULTISITE: ${{ matrix.multisite }}
55+
run: ./vendor/bin/phpunit

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

CLAUDE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# WP REST API Log
2+
3+
WordPress plugin that logs REST API requests and responses.
4+
5+
- **Main branch**: `develop` (use for PRs)
6+
7+
## Project Structure
8+
9+
- `wp-rest-api-log.php` — plugin entry point, bootstraps all classes
10+
- `includes/` — core classes (DB, controller, request/response models, filters, settings)
11+
- `admin/` — admin UI classes and partials
12+
- `tests/` — PHPUnit tests
13+
14+
## Running Tests
15+
16+
Tests require a WordPress develop checkout and a MySQL database.
17+
18+
```bash
19+
# Set the path to your wordpress-develop clone
20+
export WP_DEVELOP_DIR="/path/to/wordpress-develop"
21+
22+
# Install dependencies
23+
composer install
24+
25+
# Run tests
26+
./vendor/bin/phpunit
27+
```
28+
29+
The test database (`wordpress_test`) must exist before running tests.
30+
31+
## Coding Standards
32+
33+
Uses WordPress Coding Standards (WPCS) via `wp-coding-standards/wpcs`.
34+
35+
```bash
36+
./vendor/bin/phpcs --standard=WordPress .
37+
```
38+
39+
## CI
40+
41+
CI is being migrated from Travis CI (`.travis.yml`) to GitHub Actions (`.github/workflows/`).

bin/install-wp-core.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ set -euo pipefail
1212

1313
# Set up WordPress installation.
1414
export WP_DEVELOP_DIR=./tmp/wordpress/
15-
export WP_VERSION=6.2
1615

1716
if [ -d "$WP_DEVELOP_DIR" ]
1817
then
@@ -23,7 +22,7 @@ fi
2322
mkdir -p $WP_DEVELOP_DIR
2423

2524
# Use the Git mirror of WordPress.
26-
git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
25+
git clone --depth=1 --branch="$WP_VERSION" https://develop.git.wordpress.org/ $WP_DEVELOP_DIR
2726

2827
# Set up WordPress configuration.
2928
pushd $WP_DEVELOP_DIR

0 commit comments

Comments
 (0)