From 4b39d912bad62fa6ba0f5b578873d4cbcea524bf Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 1 Aug 2021 18:46:11 +0200 Subject: [PATCH 1/3] GH Actions: fail the build if a test run fails The way things were set up now in the `phpunit` job, no matter whether tests passed or failed, the workflow would always continue. I suspect this may have been set-up this way to make sure that all variations of test runs will actually be run ? The downside is that, while you will see a :x: for the individual build, the workflow will not be marked as failed if a test runs fails. I'm proposing to change this now by: * Removing the `continue-on-error` for the test run. * Adding the `fail-fast` key and setting it to `false`. By default this key is set to `true`, which means that if any individual build within the job fails, all other builds within the job will be cancelled. By setting it to `false`, all builds in the matrix will still be run, but if any of them fail, the workflow will be marked as "failed". --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 69a1933..47a92c3 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -61,6 +61,7 @@ jobs: runs-on: ${{ matrix.operating-system }} continue-on-error: ${{ matrix.php-versions == '8.1' }} strategy: + fail-fast: false matrix: operating-system: - ubuntu-latest @@ -125,7 +126,6 @@ jobs: run: composer install --no-interaction --prefer-dist --optimize-autoloader - name: Run PHPUnit - continue-on-error: true run: php tools/phpunit codestyle: From 46523b1a6af2eb6743e7a9e9845240c0f2b32662 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 1 Aug 2021 19:26:09 +0200 Subject: [PATCH 2/3] Phive: upgrade used version of PHPUnit The tests were not actually running on PHP 8, nor PHP 8.1, due to PHPUnit 8.4 being used, which is not compatible with PHP 8.0+. The first compatible version in the 8.x range is 8.5 and on the 9.x. range, 9.3. As for PHP 8.1, there is currently no guarantee yet, but your best bet is using the latest release of PHPUnit. The `push.yml` script already contains code to _downgrade_ the PHPUnit version used by Phive for PHP 7.2 back to PHPUnit 8, so it should be safe to upgrade the PHPUnit version for PHP 7.3 and above to PHPUnit 9.5.x. The only concession which needs to be made is for the `phpunit-with-coverage` to be run on PHP 7.3 (or to also downgrade to PHPUnit 8). --- .github/workflows/push.yml | 2 +- phive.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 47a92c3..e5ea31f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -35,7 +35,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.2 + php-version: 7.3 ini-values: memory_limit=2G, display_errors=On, error_reporting=-1 coverage: pcov tools: phive diff --git a/phive.xml b/phive.xml index 290682a..5be7457 100644 --- a/phive.xml +++ b/phive.xml @@ -1,4 +1,4 @@ - + From 4650dd0aa9fbb8859be5517f6720b716fad43862 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 1 Aug 2021 19:30:37 +0200 Subject: [PATCH 3/3] PHPUnit config: fix configuration The `tests/integration` directory does not exist and PHPUnit 9.x will fail on the configuration being invalid. --- phpunit.xml.dist | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8987852..0ac021a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,9 +10,6 @@ ./tests/unit/ - - ./tests/integration/ -