From d06601dcb27dc867776fd15f3db5cfd47e3724cc Mon Sep 17 00:00:00 2001 From: Michael Kramer Date: Sat, 5 Jul 2025 14:43:29 +0200 Subject: [PATCH 1/2] Add PHPUnit 11.5 testing, allow it to fail in CI --- .../workflows/exercise-tests-phpunit-11.yml | 48 +++++++++++++++++++ composer.json | 6 +-- 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/exercise-tests-phpunit-11.yml diff --git a/.github/workflows/exercise-tests-phpunit-11.yml b/.github/workflows/exercise-tests-phpunit-11.yml new file mode 100644 index 00000000..11e3e811 --- /dev/null +++ b/.github/workflows/exercise-tests-phpunit-11.yml @@ -0,0 +1,48 @@ +name: Exercise tests with PHPUnit 11 + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + +jobs: + test: + name: PHP ${{ matrix.php-version }} - ${{ matrix.os }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # php-version: [8.2, 8.3, 8.4] + # os: [ubuntu-24.04, windows-2022, macOS-14] + php-version: [8.4] + os: [ubuntu-24.04] + + steps: + - name: Set git line endings + if: ${{ matrix.os == 'windows-2022' }} + run: | + git config --system core.autocrlf false + git config --system core.eol lf + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e + with: + php-version: ${{ matrix.php-version }} + extensions: gmp + + - name: Install dependencies + shell: bash + run: | + curl -Lo ./bin/phpunit-11.phar https://phar.phpunit.de/phpunit-11.phar + chmod +x bin/phpunit-11.phar + + - name: Test exercises + continue-on-error: true + shell: bash + env: + PHPUNIT_BIN: 'bin/phpunit-11.phar' + XDEBUG_MODE: off + run: bin/test.sh diff --git a/composer.json b/composer.json index 9f6fb255..486f215a 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ }, "require-dev": { "php": "^8.1", - "phpunit/phpunit": "^10.5", - "slevomat/coding-standard": "^8.14.1", - "squizlabs/php_codesniffer": "^3.11.1" + "phpunit/phpunit": "^10.5 | ^11.5", + "slevomat/coding-standard": "^8.19.1", + "squizlabs/php_codesniffer": "^3.13.2" }, "scripts": { "post-install-cmd": [ From 3adbbbaeb83315bffa7cb4c21b7e320ed0637291 Mon Sep 17 00:00:00 2001 From: Michael Kramer Date: Sat, 5 Jul 2025 15:08:25 +0200 Subject: [PATCH 2/2] Update README on PHP versions running in CI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25972da3..3732cea6 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ The `lint:check` is included in `composer ci` to run the CI checks locally. - Follow the [PSR-12] coding style (Exercisms PHP track uses a slightly [modified][local-file-phpcs-config] version of [PSR-12]). - Run `composer ci` to run CI checks locally before pushing. - CI is run on all pull requests, it must pass the required checks for merge. -- CI is running all tests on PHP 8.0 to PHP 8.2 for Linux, Windows and MacOS. +- CI is running all tests on PHP 8.1 to PHP 8.4 for Linux, Windows and MacOS. ## Generating new practice exercises