Files
2meet-data-optimizer-hivepr…/.gitea/workflows/test.yml
T
wpdev 843a8e2156
Tests / PHP Lint (push) Successful in 5s
Tests / Unit Tests (push) Successful in 15s
ci: 加入 test workflow(lint + unit)
unit job 會一併 checkout 核心 plugin — 本 AddOn 的測試 bootstrap 直接
require 核心的 tests/bootstrap.php。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:20:07 +08:00

47 lines
1.4 KiB
YAML

name: Tests
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
lint:
name: PHP Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check PHP syntax
run: |
find . -name "*.php" ! -path "./vendor/*" ! -path "./tests/*" -print0 | xargs -0 -n1 php -l
echo "PHP syntax OK"
unit:
name: Unit Tests
runs-on: ubuntu-latest
# The suite boots off the core plugin's test bootstrap, so the core must be
# checked out next to this AddOn under wp-content/plugins/.
steps:
- uses: actions/checkout@v4
with:
path: 2meet-data-optimizer-hivepress-addon
- name: Checkout core plugin
uses: actions/checkout@v4
with:
repository: wpdev/2meet-data-optimizer
path: 2meet-data-optimizer
- name: Install dependencies
working-directory: 2meet-data-optimizer-hivepress-addon
run: composer install --no-interaction --prefer-dist
- name: Install core dev dependencies (test bootstrap needs them)
working-directory: 2meet-data-optimizer
run: composer install --no-interaction --prefer-dist
- name: Run unit tests
working-directory: 2meet-data-optimizer-hivepress-addon
run: php vendor/bin/phpunit --configuration phpunit.xml --testdox