Skip to content

Commit 76dcd72

Browse files
committed
chore: add resolved phpunit version to CI summary
1 parent 4595e1b commit 76dcd72

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ jobs:
7171
${{ matrix.update-constraints }}
7272
shell: bash
7373

74-
- name: Set PHPUnit schema version
74+
- name: Set PHPUnit version
7575
id: set-phpunit-version
7676
run: |
77+
echo "Tested against PHPUnit **v$(composer print-phpunit-version)**" >> "$GITHUB_STEP_SUMMARY"
7778
echo "PHPUNIT_SCHEMA_VERSION=$(composer print-phpunit-schema-version)" >> "$GITHUB_OUTPUT"
7879
shell: bash
7980

80-
- name: Show PHPUnit schema version
81-
id: show-phpunit-version
82-
run: |
83-
echo "PHPUNIT_SCHEMA_VERSION=${{ steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION }}"
84-
8581
- name: Run tests
8682
if: ${{ matrix.os != 'windows-latest' && steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION != '10.0' }}
8783
run: composer test

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
"@test-report-windows-phpunit10.0",
117117
"@test-psalm"
118118
],
119+
"print-phpunit-version": [
120+
"Qameta\\Allure\\PHPUnit\\Scripts\\CiScripts::printPhpUnitVersion"
121+
],
119122
"print-phpunit-schema-version": [
120123
"Qameta\\Allure\\PHPUnit\\Scripts\\CiScripts::printConfigSchemaVersion"
121124
]

scripts/CiScripts.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
final class CiScripts
66
{
7+
/**
8+
* Prints the version of PHPUnit.
9+
*/
10+
public static function printPhpUnitVersion(): void
11+
{
12+
if (class_exists(\PHPUnit\Runner\Version::class)) {
13+
echo(\PHPUnit\Runner\Version::id());
14+
}
15+
}
16+
717
/**
818
* Prints the version of the PHPUnit XML schema.
919
* We use this in the CI pipeline to deside which configuration file to use.

0 commit comments

Comments
 (0)