Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW Add endtoend_tag param #31

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ inputs:
type: string
required: false
default: ''
endtoend_tags:
type: string
required: false
default: ''
js:
type: boolean
default: false
Expand All @@ -46,6 +50,7 @@ runs:
PHPUNIT_SUITE: ${{ inputs.phpunit_suite }}
ENDTOEND_SUITE: ${{ inputs.endtoend_suite }}
ENDTOEND_CONFIG: ${{ inputs.endtoend_config }}
ENDTOEND_TAGS: ${{ inputs.endtoend_config }}
run: |
if ! [[ "$PHPUNIT_SUITE" =~ ^[a-zA-Z0-9_\-]*$ ]]; then
echo "Invalid input for phpunit_suite"
Expand All @@ -59,6 +64,10 @@ runs:
echo "Invalid input for endtoend_config"
exit 1
fi
if ! [[ "$ENDTOEND_TAGS" =~ ^[a-zA-Z0-9,]*$ ]]; then
echo "Invalid input for endtoend_tags"
exit 1
fi

- name: Run PHPUnit
# input booleans are converted to strings
Expand Down Expand Up @@ -114,6 +123,7 @@ runs:
env:
ENDTOEND_SUITE: ${{ inputs.endtoend_suite }}
ENDTOEND_CONFIG: ${{ inputs.endtoend_config }}
ENDTOEND_TAGS: ${{ inputs.endtoend_tags }}
run: |
echo "Running behat"
BEHAT_CONFIG="behat.yml"
Expand Down Expand Up @@ -144,9 +154,17 @@ runs:
# start chromedriver as a background process
nohup sh -c "chromedriver" > /dev/null 2>&1 &
if [[ "$ENDTOEND_SUITE" != "root" ]]; then
vendor/bin/behat --colors --strict --config __behat.yml "$ENDTOEND_SUITE"
if [[ $ENDTOEND_TAGS != "" ]]; then
vendor/bin/behat --colors --strict --config __behat.yml "$ENDTOEND_SUITE" --tags="$ENDTOEND_TAGS"
else
vendor/bin/behat --colors --strict --config __behat.yml "$ENDTOEND_SUITE"
fi
else
vendor/bin/behat --colors --strict --config __behat.yml
if [[ $ENDTOEND_TAGS != "" ]]; then
vendor/bin/behat --colors --strict --config __behat.yml --tags="$ENDTOEND_TAGS"
else
vendor/bin/behat --colors --strict --config __behat.yml
fi
fi
echo "Passed"

Expand Down
Loading