From 5a3880c6e93d19d2eebb8407d06138d1e36723e6 Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Thu, 12 Nov 2026 10:46:40 +0100 Subject: [PATCH] Run CI tests against PHP 8.3, 8.4 and 8.5 Move the test steps into a matrix job and keep a aggregating `test` job so the branch protection check name stays stable. Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/ci.yml | 23 +++++++++++++++++++++-- AGENTS.md | 4 +++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0a36b1c..7ef5203 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -32,15 +32,21 @@ on: branches: ['**'] jobs: - test: + # Matrix over the supported PHP versions. + phpunit: + name: PHP ${{ matrix.php }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.3', '8.4', '8.5'] steps: - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.5' + php-version: ${{ matrix.php }} extensions: mbstring, intl, pdo_sqlite, sqlite3 coverage: none @@ -53,6 +59,19 @@ jobs: - name: Coding standard run: vendor/bin/phpcs --warning-severity=0 + # Stable check name required by the branch protection of main: green only if all PHP versions are green. + test: + needs: phpunit + if: always() + runs-on: ubuntu-latest + steps: + - name: All PHP versions passed + run: | + if [ "${{ needs.phpunit.result }}" != "success" ]; then + echo "Matrix result: ${{ needs.phpunit.result }}" >&2 + exit 1 + fi + deploy: needs: test # Deactivated until the repository variable DEPLOY_ENABLED is "true". diff --git a/AGENTS.md b/AGENTS.md index 864a7d2..93dcd11 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -333,7 +333,9 @@ Kein WebSocket: Presenter (`/admin/{token}/state`) und Teilnehmende (`/p/{code}/ Deploy erfolgt über Git (Remote: Gitea) mit `.gitea/workflows/ci.yml`: -- Job `test` (PHPUnit + phpcs) läuft bei jedem Push auf jeden Branch. `main` ist per Branch-Schutz +- Job `phpunit` (PHPUnit + phpcs) läuft bei jedem Push auf jeden Branch, als Matrix gegen PHP 8.3, 8.4 und 8.5. + Der Sammel-Job `test` ist nur grün, wenn alle Matrix-Läufe grün sind, und bleibt der Check, den der Branch-Schutz + verlangt (so muss dort bei neuen PHP-Versionen nichts angepasst werden). `main` ist per Branch-Schutz in Gitea gesperrt: kein direkter Push, Merge nur per PR und nur mit grünem Status-Check des Jobs `test`. - Job `deploy` läuft nur bei Push auf `main`, nur bei grünen Tests und **nur wenn die Repo-Variable `DEPLOY_ENABLED=true` gesetzt ist** (standardmäßig deaktiviert). Er verbindet sich per SSH