-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
81 lines (70 loc) · 2.11 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: 'Run Pest'
description: 'Requires Docker image to be set up'
inputs:
image:
description: 'PHP Docker image to use'
required: false
php-version:
description: 'PHP version to use. If image is set, this will be ignored.'
default: '7.4'
required: false
php-args:
description: 'Arguments to pass to PHP. Should be a multiline string.'
required: false
pest-args:
description: 'Arguments to pass to Pest. Should be a multiline string.'
required: false
# deprecated, use pest-args
# TODO: Remove in v5
args:
description: 'Arguments to pass to Pest. Should be a multiline string.'
required: false
runs:
using: composite
steps:
- uses: myparcelnl/actions/deprecated@v4
if: inputs.args != ''
with:
name: 'inputs.args'
replacement: 'inputs.pest-args'
reason: 'To prevent confusion with inputs.php-args.'
- uses: myparcelnl/actions/composer-install@v4
id: install
if: inputs.image == ''
with:
php-version: ${{ inputs.php-version }}
- uses: myparcelnl/actions/composer-create-env-file@v4
id: env
- uses: myparcelnl/actions/format-string@v4
id: php-args
with:
mode: 'args'
string: |
-dpcov.enabled=1
${{ inputs.php-args }}
- uses: myparcelnl/actions/format-string@v4
id: pest-args
with:
mode: 'args'
string: |
--no-interaction
--colors=always
--coverage-clover=clover.xml
--log-junit=junit.xml
${{ inputs.pest-args || inputs.args }}
- name: 'Run Pest'
env:
ENV_FILE: ${{ steps.env.outputs.filename }}
IMAGE: ${{ inputs.image || steps.install.outputs.image }}
PEST_ARGS: ${{ steps.pest-args.outputs.string }}
PHP_ARGS: ${{ steps.php-args.outputs.string }}
TERM: xterm-256color
shell: bash
#language=bash
run: |
docker run -t \
--env-file="$ENV_FILE" \
--user $(id -u):$(id -g) \
--volume "$PWD:/app" \
"$IMAGE" \
php $PHP_ARGS vendor/bin/pest $PEST_ARGS