Skip to content

Commit bcb119b

Browse files
carlbennettclaude
andcommitted
Split PHPUnit tests into separate php-tests workflow; align PHP packages
- Move PHPUnit step from php-linter into new php-tests.yml - All three workflows now install the same PHP packages: php-cli, php-mbstring, php-xml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c9ee827 commit bcb119b

3 files changed

Lines changed: 47 additions & 4 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: sudo apt-get update
3030

3131
- name: Install PHP ${{ env.PHP_VERSION }}
32-
run: sudo apt-get install php${{ env.PHP_VERSION }}-cli
32+
run: sudo apt-get install php${{ env.PHP_VERSION }}-cli php${{ env.PHP_VERSION }}-mbstring php${{ env.PHP_VERSION }}-xml
3333

3434
- name: Validate composer.json and composer.lock
3535
run: composer validate --strict

.github/workflows/php-linter.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,3 @@ jobs:
4747

4848
- name: Validate PHP syntax
4949
run: bash -c 'set -e;for file in $(find ./src ./tests -type f -regex ".*\.\(php\|phtml\)" -print); do php -e -l -f "$file"; done'
50-
51-
- name: Run PHPUnit tests
52-
run: lib/bin/phpunit --testdox

.github/workflows/php-tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# vim: set colorcolumn=:
2+
name: php-tests
3+
4+
on:
5+
push:
6+
pull_request:
7+
workflow_dispatch:
8+
inputs:
9+
php_version:
10+
description: "Specify the PHP version to use (e.g., 8.3)"
11+
required: false
12+
default: '8.3'
13+
14+
env:
15+
PHP_VERSION: ${{ inputs.php_version || '8.3' }}
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
tests:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Update apt cache
28+
run: sudo apt-get update
29+
30+
- name: Install php ${{ env.PHP_VERSION }}
31+
run: sudo apt-get install php${{ env.PHP_VERSION }}-cli php${{ env.PHP_VERSION }}-mbstring php${{ env.PHP_VERSION }}-xml
32+
33+
- name: Cache Composer packages
34+
id: composer-cache
35+
uses: actions/cache@v4
36+
with:
37+
path: lib
38+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-php-
41+
42+
- name: Install composer/vendor dependencies
43+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
44+
45+
- name: Run PHPUnit tests
46+
run: lib/bin/phpunit --testdox

0 commit comments

Comments
 (0)