Skip to content

Commit cf55277

Browse files
author
Greg Bowler
authored
Merge pull request #14 from php-actions/version-sync
V8 release
2 parents acad1ec + 139cfd0 commit cf55277

File tree

4 files changed

+155
-23
lines changed

4 files changed

+155
-23
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ 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 composer global require --no-progress phpunit/phpunit 9.*
8+
RUN composer global require --no-progress phpunit/phpunit 8.*
99
COPY entrypoint /usr/local/bin/entrypoint
1010
ENTRYPOINT ["/usr/local/bin/entrypoint"]

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v2
2525
- uses: php-actions/composer@v1 # or alternative dependency management
26-
- uses: php-actions/phpunit@v1
26+
- uses: php-actions/phpunit@v8
2727
# ... then your own project steps ...
2828
```
2929

@@ -48,10 +48,26 @@ jobs:
4848
...
4949

5050
- name: PHPUnit tests
51-
uses: php-actions/phpunit@v1
51+
uses: php-actions/phpunit@v8
5252
with:
5353
config: custom/path/to/phpunit.xml
5454
memory: 256M
5555
```
5656
5757
If you require other configurations of phpunit, please request them in the [Github issue tracker](https://github.com/php-actions/phpunit/issues)
58+
59+
Versions
60+
--------
61+
62+
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.
63+
64+
Current versions supported by this Action:
65+
66+
+ 9.*
67+
+ 8.*
68+
69+
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)
70+
71+
If you found this repository helpful, please consider [sponsoring the developer][sponsor].
72+
73+
[sponsor]: https://github.com/sponsors/g105b

action.yml

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,86 @@ name: PHPUnit (php-actions)
22
description: Run your PHPUnit tests in your Github Actions.
33

44
inputs:
5-
config:
5+
configuration:
66
description: Configuration file location
77
required: false
8-
default: phpunit.xml
98

10-
junit:
9+
log_junit:
10+
description: JUnit output file location
11+
required: false
12+
13+
log_teamcity:
14+
description: JUnit output file location
15+
required: false
16+
17+
testdox_html:
18+
description: JUnit output file location
19+
required: false
20+
21+
testdox_text:
22+
description: JUnit output file location
23+
required: false
24+
25+
testdox_xml:
1126
description: JUnit output file location
1227
required: false
13-
default: junit.xml
1428

15-
memory:
29+
memory_limit:
1630
description: Memory limit
1731
required: false
18-
default: 512M
1932

2033
bootstrap:
2134
description: Path to bootstrap file
2235
required: false
2336
default: vendor/autoload.php
24-
37+
38+
filter:
39+
description: Filter which tests to run
40+
required: false
41+
2542
testsuite:
2643
description: Specify a testsuite to run
2744
required: false
2845

46+
group:
47+
description: Only runs tests from the specified group(s)
48+
required: false
49+
50+
exclude_group:
51+
description: Exclude tests from the specified group(s)
52+
required: false
53+
54+
test_suffix:
55+
description: Only search for test in files with specified suffix(es)
56+
required: false
57+
default: Test.php,.phpt
58+
59+
whitelist:
60+
description: Path to directory to whitelist for code coverage analysis
61+
required: false
62+
63+
args:
64+
description: Extra arguments to pass to the phpunit binary
65+
required: false
66+
2967
runs:
3068
using: 'docker'
3169
image: 'Dockerfile'
32-
args:
33-
- -c
34-
- ${{ inputs.config }}
35-
- --log-junit
36-
- ${{ inputs.junit }}
37-
- -d
38-
- "memory_limit=${{ inputs.memory }}"
39-
- --bootstrap
40-
- ${{ inputs.bootstrap }}
41-
- --testsuite
42-
- ${{ inputs.testsuite }}
70+
env:
71+
action_configuration: ${{ inputs.configuration }}
72+
action_log_junit: ${{ inputs.log_junit }}
73+
action_testdox_html: ${{ inputs.testdox_html }}
74+
action_testdox_text: ${{ inputs.testdox_text }}
75+
action_testdox_xml: ${{ inputs.testdox_xml }}
76+
action_bootstrap: ${{ inputs.bootstrap }}
77+
action_filter: ${{ inputs.filter }}
78+
action_testsuite: ${{ inputs.testsuite }}
79+
action_group: ${{ inputs.group }}
80+
action_exclude_group: ${{ inputs.exclude_group }}
81+
action_test_suffix: ${{ inputs.test_suffix }}
82+
action_whitelist: ${{ inputs.whitelist }}
83+
action_memory_limit: ${{ inputs.memory_limit }}
84+
action_args: ${{ inputs.args }}
4385

4486
branding:
4587
icon: 'check-square'

entrypoint

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,78 @@
11
#!/bin/bash
22
set -e
33
PATH=/tmp/vendor/bin:$PATH
4-
phpunit "$@"
4+
5+
command_string="phpunit"
6+
7+
if [ -n "$action_configuration" ]
8+
then
9+
command_string="$command_string --configuration '$action_configuration'"
10+
fi
11+
12+
if [ -n "$action_log_junit" ]
13+
then
14+
command_string="$command_string --log-junit '$action_log_junit'"
15+
fi
16+
17+
if [ -n "$action_testdox_html" ]
18+
then
19+
command_string="$command_string --testdox-html '$action_testdox_html'"
20+
fi
21+
22+
if [ -n "$action_testdox_text" ]
23+
then
24+
command_string="$command_string --testdox-text '$action_testdox_text'"
25+
fi
26+
27+
if [ -n "$action_testdox_xml" ]
28+
then
29+
command_string="$command_string --testdox-xml '$action_testdox_xml'"
30+
fi
31+
32+
if [ -n "$action_bootstrap" ]
33+
then
34+
command_string="$command_string --bootstrap '$action_bootstrap'"
35+
fi
36+
37+
if [ -n "$action_filter" ]
38+
then
39+
command_string="$command_string --filter '$action_filter'"
40+
fi
41+
42+
if [ -n "$action_testsuite" ]
43+
then
44+
command_string="$command_string --testsuite '$action_testsuite'"
45+
fi
46+
47+
if [ -n "$action_group" ]
48+
then
49+
command_string="$command_string --group '$action_group'"
50+
fi
51+
52+
if [ -n "$action_exclude_group" ]
53+
then
54+
command_string="$command_string --exclude-group '$action_exclude_group'"
55+
fi
56+
57+
if [ -n "$action_test_suffix" ]
58+
then
59+
command_string="$command_string --test-suffix '$action_test_suffix'"
60+
fi
61+
62+
if [ -n "$action_whitelist" ]
63+
then
64+
command_string="$command_string --whitelist '$action_whitelist'"
65+
fi
66+
67+
if [ -n "$action_memory_limit" ]
68+
then
69+
command_string="$command_string -d memory_limit=$action_memory_limit"
70+
fi
71+
72+
if [ -n "$action_args" ]
73+
then
74+
command_string="$command_string $action_args"
75+
fi
76+
77+
echo "Command: $command_string"
78+
eval "$command_string"

0 commit comments

Comments
 (0)