Skip to content

Commit 86fc1ee

Browse files
committed
Implements 8.0, 8.1, 8.2 testig with lowest and highest dependencies.
1 parent 23d7552 commit 86fc1ee

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

.github/workflows/php.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,36 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
14-
13+
tests:
1514
runs-on: ubuntu-latest
16-
15+
name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}"
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
# normal, highest, non-dev installs
20+
php-version: [ '8.2', '8.1', '8.0' ]
21+
dependency-versions: [ 'highest', 'lowest' ]
22+
include:
23+
# - php-version: '8.2'
24+
# dependency-versions: 'lowest'
25+
- php-version: '8.1'
26+
dependency-versions: 'lowest'
27+
- php-version: '8.0'
28+
dependency-versions: 'lowest'
29+
- php-version: '8.2'
30+
dependency-versions: 'highest'
31+
- php-version: '8.1'
32+
dependency-versions: 'highest'
33+
- php-version: '8.0'
34+
dependency-versions: 'highest'
1735
steps:
1836
- uses: actions/checkout@v3
1937

20-
# - name: Validate composer.json and composer.lock
21-
# run: composer validate --strict
22-
38+
- name: "Install PHP"
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
coverage: "xdebug"
42+
php-version: "${{ matrix.php-version }}"
2343
- name: Cache Composer packages
2444
id: composer-cache
2545
uses: actions/cache@v3
@@ -29,8 +49,11 @@ jobs:
2949
restore-keys: |
3050
${{ runner.os }}-php-
3151
32-
- name: Install dependencies
33-
run: composer install --prefer-dist --no-progress
52+
- name: "Composer install"
53+
uses: "ramsey/composer-install@v2"
54+
with:
55+
dependency-versions: "${{ matrix.dependency-versions }}"
56+
composer-options: "--prefer-dist --no-cache --no-progress"
3457

3558
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
3659
# Docs: https://getcomposer.org/doc/articles/scripts.md

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"ergebnis/composer-normalize": "^2.29",
3333
"friendsofphp/php-cs-fixer": "^3.13",
3434
"phpstan/phpstan": "^1.9",
35-
"phpunit/php-code-coverage": "^9.2",
36-
"phpunit/phpunit": "^9.5",
35+
"phpunit/php-code-coverage": "^9",
36+
"phpunit/phpunit": "^9.6",
3737
"symfony/expression-language": "^5.4 || ^6",
3838
"symfony/intl": "^5.4 || ^6",
3939
"symfony/var-dumper": "^5.4 || ^6",
40-
"vimeo/psalm": "^5.2"
40+
"vimeo/psalm": "^5.5"
4141
},
4242
"suggest": {
4343
"ext-intl": "You need this PHP extension if you will be using `time_zone` alidator with option `intl_compatible`",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ public function testSerializeEmpty(): void
8181
$empty = $this->createEmptyDto();
8282
$json = file_get_contents(__DIR__.'/json_empty.json');
8383

84-
$this->testSerialize($empty, $json);
84+
$this->serializeTest($empty, $json);
8585
}
8686

8787
public function testSerializeValid(): void
8888
{
8989
$json = file_get_contents(__DIR__.'/json_valid.json');
90-
$this->testSerialize($this->createValidDto(), $json);
90+
$this->serializeTest($this->createValidDto(), $json);
9191
}
9292

9393
public function testIterableDto(): void
@@ -113,7 +113,7 @@ public function testIterableDto(): void
113113
$simpleUser[$invalidProperty];
114114
}
115115

116-
protected function testSerialize(AbstractDto $dtoTransfer, string $exceptedJson): void
116+
private function serializeTest(AbstractDto $dtoTransfer, string $exceptedJson): void
117117
{
118118
$serializer = new SerializerFacadeDefault();
119119

0 commit comments

Comments
 (0)