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
31 changes: 0 additions & 31 deletions .github/workflows/lint-and-analyse-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,6 @@ jobs:
globs: |
*.md

phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2", "8.3", "8.4"]
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Install Composer dependencies
# Allow the previous check to fail but not abort
if: always()
uses: ramsey/composer-install@v3

- name: Create main config.php for unit tests
run: cp config/config.dist.php config/config.php

- name: Unit Tests
run: |
set -o pipefail
composer phpunit | tee phpunit.log
if ! grep -qE "Tests:|OK \(" phpunit.log; then
echo "❌ PHPUnit exited early (no summary line found)"
exit 1
fi

lint-php-files:
runs-on: ubuntu-latest
strategy:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: PHPUnit

# If a pull-request is pushed then cancel all previously running jobs related
# to that pull-request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

on:
# push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- develop

permissions:
contents: read

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2", "8.3", "8.4"]
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Create main config.php for unit tests
run: cp config/config.dist.php config/config.php

- name: Unit Tests
run: |
set -o pipefail
composer phpunit | tee phpunit.log
if ! grep -qE "Tests:|OK \(" phpunit.log; then
echo "❌ PHPUnit exited early (no summary line found)"
exit 1
fi