From 843a8e2156f2a10deb17dbe68637806320a233d0 Mon Sep 17 00:00:00 2001 From: wpdev Date: Fri, 31 Jul 2026 09:20:07 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=8A=A0=E5=85=A5=20test=20workflow?= =?UTF-8?q?=EF=BC=88lint=20+=20unit=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit unit job 會一併 checkout 核心 plugin — 本 AddOn 的測試 bootstrap 直接 require 核心的 tests/bootstrap.php。 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY --- .gitea/workflows/test.yml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..41daaf9 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,46 @@ +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