Skip to content
Open
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
64 changes: 64 additions & 0 deletions .github/workflows/tests.php.unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: PHP Unit Tests

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
include:
- php-version: '7.0'
allow_failure: true
- php-version: '7.1'
allow_failure: true
- php-version: '7.2'
allow_failure: true
- php-version: '7.3'
allow_failure: true
- php-version: '7.4'
allow_failure: true
- php-version: '8.0'
allow_failure: true
- php-version: '8.1'
allow_failure: true
- php-version: '8.2'
allow_failure: true
- php-version: '8.3'
allow_failure: true
- php-version: '8.4'
allow_failure: true
- php-version: '8.5'
allow_failure: true
Comment on lines +26 to +48

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Test failures on almost every supported PHP version do not fail the CI check

Every modern PHP version from 7.0 through 8.5 is marked as allowed to fail (allow_failure: true at .github/workflows/tests.php.unit.yml:26-48), leaving only the two oldest, end-of-life versions able to fail the build, so real breakages on supported versions still show a green check.
Impact: A change that breaks the library on any currently-used PHP version (7.0–8.5) will pass CI unnoticed, defeating the purpose of the test matrix.

continue-on-error covers the whole modern matrix

The include block (.github/workflows/tests.php.unit.yml:26-48) sets allow_failure: true for PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5 — i.e. every version except 5.5 and 5.6. Combined with continue-on-error: ${{ matrix.allow_failure || false }} (.github/workflows/tests.php.unit.yml:49), only the PHP 5.5 and 5.6 jobs can actually turn the workflow red. Failures in all other jobs are ignored.

Prompt for agents
The workflow marks allow_failure: true for every PHP version from 7.0 through 8.5, so only the two oldest EOL versions (5.5, 5.6) can fail the build. This inverts the usual intent and means regressions on all supported/modern PHP versions produce a green check. Reconsider which versions should be allowed to fail — typically only bleeding-edge or explicitly-unsupported versions should be non-blocking, and the versions the library officially supports should be required.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

continue-on-error: ${{ matrix.allow_failure || false }}
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
coverage: xdebug
extensions: gd, json, mbstring
php-version: ${{ matrix.php-version }}
- run: composer install --no-interaction --prefer-dist
- run: vendor/bin/phpunit
- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: coverallsapp/github-action@v2
if: success()
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}

RUN apk add --no-cache \
libpng \
libpng-dev \
${PHPIZE_DEPS} \
&& docker-php-ext-install gd \
&& pecl install xdebug-2.5.5 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Docker image fails to build for the PHP versions the project targets

The container build hard-codes an ancient coverage tool version (pecl install xdebug-2.5.5 at Dockerfile:9) that can only be compiled on PHP 7.1 and older, so building the image for any newer PHP version aborts with a compilation error.
Impact: Anyone building the Docker image for PHP 7.2 through 8.5 (the versions this project claims to support) gets a failed build and cannot run the tests in the container.

Version incompatibility between pinned Xdebug and modern PHP

The Dockerfile accepts an ARG PHP_VERSION (Dockerfile:1-2) so the image is intended to be built for any of the PHP versions in the test matrix (.github/workflows/tests.php.unit.yml:12-25, up to 8.5). However pecl install xdebug-2.5.5 (Dockerfile:9) pins Xdebug 2.5.5, which only supports PHP 5.5–7.1. For PHP 7.2+ (and especially PHP 8.x, which needs Xdebug 3.x) the PECL build fails, breaking docker build. Additionally ENV XDEBUG_MODE coverage (Dockerfile:15) is an Xdebug 3-only setting and is a no-op with the pinned 2.5.5.

Prompt for agents
The Dockerfile pins xdebug-2.5.5 via `pecl install xdebug-2.5.5`, but this version only compiles on PHP <= 7.1. Since the image is parameterized by ARG PHP_VERSION and the project's test matrix goes up to PHP 8.5, the build will fail for PHP 7.2+ (PHP 8.x requires Xdebug 3.x). Consider installing Xdebug without pinning an old version (e.g. `pecl install xdebug`) so PECL selects a version compatible with the target PHP, or select the Xdebug version based on PHP_VERSION. Note that ENV XDEBUG_MODE coverage only takes effect with Xdebug 3.x.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

&& docker-php-ext-enable xdebug \
&& apk del libpng-dev ${PHPIZE_DEPS}

COPY --from=composer /usr/bin/composer /usr/bin/composer

ENV XDEBUG_MODE coverage

WORKDIR /code

CMD ["php", "./vendor/bin/phpunit"]
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
},
"require-dev": {
"php" : ">=5.5",
"josegonzalez/dotenv": "~2.0",
"phpunit/phpunit" : "~4.8",
"satooshi/php-coveralls": "~0.6",
"scrutinizer/ocular": "~1.1",
"whatthejeff/nyancat-phpunit-resultprinter": "~1.2"
"josegonzalez/dotenv": "^2.0",
"phpunit/phpunit" : ">=4.8",
"satooshi/php-coveralls": "^1 || ^2",
"scrutinizer/ocular": ">=1.1",
"yoast/phpunit-polyfills": "*"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 2 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"

backupGlobals="false"
strict="true"
Expand All @@ -21,12 +21,9 @@
colors="true"
forceCoversAnnotation="true"
verbose="true"

printerFile="vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php"
printerClass="NyanCat\PHPUnit\ResultPrinter"
>
<testsuites>
<testsuite name="Flysystem Github Adapter - Unit Tests">
<testsuite name="Flysystem GitHub Adapter - Unit Tests">
<directory>tests/unit-tests</directory>
</testsuite>
</testsuites>
Expand Down
Loading