Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Add PHPUnit 10 and PHP 8.3 #656

Merged
merged 5 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
48 changes: 48 additions & 0 deletions .github/workflows/exercise-tests-phpunit-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Exercise tests with PHPUnit 10

on:
workflow_dispatch:
push:
branches:
- main
- master
tomasnorre marked this conversation as resolved.
Show resolved Hide resolved
pull_request:

jobs:
test:
name: PHP ${{ matrix.php-version }} - ${{ matrix.os }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: true
mk-mxp marked this conversation as resolved.
Show resolved Hide resolved
strategy:
fail-fast: false
matrix:
#php-version: [8.1, 8.2, 8.3]
php-version: [8.3]
#os: [ubuntu-22.04, windows-2022, macOS-12]
os: [ubuntu-22.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@b4ffde65f46336ab88eb53be808477a3936bae11

- uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d
with:
php-version: ${{ matrix.php-version }}
extensions: gmp

- name: Install dependencies
shell: bash
run: |
curl -Lo ./bin/phpunit-10.phar https://phar.phpunit.de/phpunit-10.phar
chmod +x bin/phpunit-10.phar

- name: Test exercises\
tomasnorre marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
env:
PHPUNIT_BIN: 'bin/phpunit-10.phar'
run: bin/test.sh
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}
},
"require-dev": {
"php": "^7.4|^8.0",
"phpunit/phpunit": "^9.6",
"php": "^7.4 || ^8.0",
"phpunit/phpunit": "^9.6 || ^10.5",
"slevomat/coding-standard": "^8.14.1",
"squizlabs/php_codesniffer": "^3.9"
},
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/allergies/AllergiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testAllergiesToOneAllergen($allergicTo): void
}, $otherAllergen);
}

public function provideListOfAllergen(): array
public static function provideListOfAllergen(): array
{
require_once 'Allergies.php';

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/binary/BinaryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testItOnlyAcceptsStringsContainingZerosAndOnes($value): void
parse_binary($value);
}

public function invalidValues(): array
public static function invalidValues(): array
{
return [
['2'], ['12345'], ['a'], ['0abcdef'],
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/gigasecond/GigasecondTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function dateSetup($date): DateTimeImmutable
return new DateTimeImmutable($date, $UTC);
}

public function inputAndExpectedDates(): array
public static function inputAndExpectedDates(): array
{
return [
['2011-04-25', '2043-01-01 01:46:40'],
Expand All @@ -48,7 +48,7 @@ public function inputAndExpectedDates(): array
];
}

public function inputDates(): array
public static function inputDates(): array
{
return [
['2011-04-25'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function testTranslationStopsIfStopCodonInMiddleOfSixCodonSequence(): voi
);
}

public function invalidCodonDataProvider(): array
public static function invalidCodonDataProvider(): array
{
return [
'Non-existing' => ['AAA'],
Expand Down