Skip to content

Commit 9b403f3

Browse files
author
Greg Bowler
committed
Include PHAR PHPUnit
1 parent baa77cb commit 9b403f3

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LABEL repository="https://github.com/php-actions/phpunit"
55
LABEL homepage="https://github.com/php-actions/phpunit"
66
LABEL maintainer="Greg Bowler <[email protected]>"
77

8-
RUN curl https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php -- --quiet
9-
RUN ./composer.phar global require --no-progress phpunit/phpunit 9.*
8+
RUN curl https://phar.phpunit.de/phpunit-9.4.2.phar > phpunit-9.phar
9+
RUN chmod +x *.phar
10+
RUN ln -s $(pwd)/phpunit-9.phar /usr/local/bin/phpunit
1011
COPY entrypoint /usr/local/bin/entrypoint
1112
ENTRYPOINT ["/usr/local/bin/entrypoint"]

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v2
2525
- uses: php-actions/composer@v1 # or alternative dependency management
26-
- uses: php-actions/phpunit@v9
26+
- uses: php-actions/phpunit@v1
2727
# ... then your own project steps ...
2828
```
2929

@@ -41,6 +41,8 @@ The following configuration options are available:
4141
+ `junit` Path to junit output file (default: `test/phpunit/_junit/junit.xml`)
4242
+ `memory` The memory limit to run your tests with (default: `512M`)
4343
+ `bootstrap` The path to the bootstrap file (default: `vendor/autoload.php`)
44+
+ `php_version` The version of PHP to use e.g. `7.4` (default: latest)
45+
+ `phpunit_version` The version of PHPUnit to use e.g. `9` or `9.4.2` (default: latest)
4446

4547
The syntax for passing in a custom input is the following:
4648

@@ -53,7 +55,7 @@ jobs:
5355
...
5456

5557
- name: PHPUnit tests
56-
uses: php-actions/phpunit@v9
58+
uses: php-actions/phpunit@v1
5759
with:
5860
configuration: custom/path/to/phpunit.xml
5961
memory_limit: 256M
@@ -64,16 +66,13 @@ If you require other configurations of phpunit, please request them in the [Gith
6466
Versions
6567
--------
6668
67-
The Github Actions version numbers are in sync with the PHPUnit version. This allows you to specify which version of PHPUnit your project should run by using the @ syntax.
69+
Previously, the Github Actions release version numbers were in sync with the PHPUnit version, but this imposed too many limitations. For the next 12 months, v7, v8 and v9 branches will still point to their existing commits, but we have reverted to v1-based Actions releases, allowing PHPUnit version number to be specified from your configuration, using the `phpunit_version` input variable.
6870

69-
Current versions supported by this Action:
71+
Any PHPUnit version available from https://phar.phpunit.de/ are supported.
7072

71-
+ 9.*
72-
+ 8.*
73+
Please note the version number specified within your Action configuration must match your composer.json major version number. For example, if your composer.json requires `phpunit/phpunit 8.5.8`, you must use `phpunit_version: 8.5.8`, as major versions of PHPUnit are incompatible with each other.
7374

74-
Please note **the version number of the Github Action must match your composer.json major version number**. For example, if your composer.json requires `phpunit/phpunit 8.5.8`, you must use `php-actions/phpunit@v8`, as major versions of PHPUnit are incompatible with each other.
75-
76-
If you require a specific version that is not listed here, please request them in the [Github issue tracker](https://github.com/php-actions/phpunit/issues)
75+
If you require a specific version that is not compatible with Github Actions for some reason, please make a request in the [Github issue tracker](https://github.com/php-actions/phpunit/issues).
7776

7877
If you found this repository helpful, please consider [sponsoring the developer][sponsor].
7978

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: Run your PHPUnit tests in your Github Actions.
44
inputs:
55
php_version:
66
description: What version of PHP to use
7+
default: latest
8+
required: false
9+
10+
phpunit_version:
11+
description: What version of PHPUnit to use
12+
default: latest
713
required: false
814

915
configuration:

0 commit comments

Comments
 (0)