Skip to content

Commit

Permalink
versioning workarounds in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
remorhaz committed Nov 10, 2023
1 parent 1eab991 commit 4add298
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ jobs:
${{ matrix.composer-options }}

- name: Run tests
if: ${{ matrix.os != 'windows-latest' }}
if: ${{ matrix.os != 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }}
run: composer test

- name: Run tests (lowest)
if: ${{ matrix.os != 'windows-latest' && contains(matrix.composer-options, '--prefer-lowest') }}
run: composer test-lowest

- name: Run tests (windows)
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ matrix.os == 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }}
run: composer test-windows

- name: Run tests (windows-lowest)
if: ${{ matrix.os == 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }}
run: composer test-windows-lowest
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,52 @@
"scripts": {
"test-cs": "vendor/bin/phpcs -sp",
"test-unit": "vendor/bin/phpunit --coverage-text",
"test-unit-lowest": "vendor/bin/phpunit --configuration=phpunit.10.0.xml --coverage-text",
"clear-allure-results": "rm -rf ./build/allure-results",
"test-report": [
"@clear-allure-results",
"vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=positive",
"vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=negative; exit 0"
],
"test-report-lowest": [
"@clear-allure-results",
"vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=positive",
"vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=negative; exit 0"
],
"test-report-windows": [
"@clear-allure-results",
"vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=positive",
"vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=negative & exit 0"
],
"test-report-windows-lowest": [
"@clear-allure-results",
"vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=positive",
"vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=negative & exit 0"
],
"test-psalm": "vendor/bin/psalm --shepherd",
"test": [
"@test-cs",
"@test-unit",
"@test-report",
"@test-psalm"
],
"test-lowest": [
"@test-cs",
"@test-unit-lowest",
"@test-report-lowest",
"@test-psalm"
],
"test-windows": [
"@test-cs",
"@test-unit",
"@test-report-windows",
"@test-psalm"
],
"test-windows-lowest": [
"@test-cs",
"@test-unit-lowest",
"@test-report-windows-lowest",
"@test-psalm"
]
}
}
20 changes: 20 additions & 0 deletions phpunit.10.0.report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
colors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
defaultTestSuite="positive">
<testsuites>
<testsuite name="positive">
<directory>test/report/Generate</directory>
<exclude>test/report/Generate/NegativeTest.php</exclude>
</testsuite>
<testsuite name="negative">
<file>test/report/Generate/NegativeTest.php</file>
</testsuite>
</testsuites>
<extensions>
<bootstrap class="Qameta\Allure\PHPUnit\AllureExtension" />
</extensions>
</phpunit>
18 changes: 18 additions & 0 deletions phpunit.10.0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
colors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
defaultTestSuite="unit">
<testsuites>
<testsuite name="unit">
<directory>test/unit/</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
</phpunit>
3 changes: 2 additions & 1 deletion phpunit.report.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
colors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
defaultTestSuite="positive">
<testsuites>
<testsuite name="positive">
Expand Down
12 changes: 8 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
colors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
defaultTestSuite="unit">
<testsuites>
<testsuite name="unit">
<directory>test/unit/</directory>
</testsuite>
</testsuites>
<coverage>
<source>
<include>
<directory suffix=".php">src/</directory>
<directory>src/</directory>
</include>
</coverage>
<exclude>
<directory>vendor/</directory>
</exclude>
</source>
</phpunit>
1 change: 1 addition & 0 deletions test/unit/Event/EventTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ protected function createTestWarningTriggeredEvent(
'file',
1,
false,
false,
);
}
}

0 comments on commit 4add298

Please sign in to comment.