-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
80 lines (69 loc) · 2.07 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
name: 'Run Behat'
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
behat-args:
description: 'Arguments to pass to Behat. Should be a multiline string.'
required: false
# deprecated, use behat-args
# TODO: Remove in v5
args:
description: 'Arguments to pass to Behat. 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.behat-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: behat-args
with:
mode: 'args'
string: |
--colors
--format=progress
--no-interaction
${{ inputs.behat-args || inputs.args }}
- name: 'Run Behat'
env:
BEHAT_ARGS: ${{ steps.behat-args.outputs.string }}
ENV_FILE: ${{ steps.env.outputs.filename }}
IMAGE: ${{ inputs.image || steps.install.outputs.image }}
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/behat $BEHAT_ARGS