From 99472fb340ad90ac2d1c968f27226e88f4b847c3 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 18 Jul 2024 13:11:30 +1200 Subject: [PATCH] NEW Add endtoend_tag param --- action.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index ef1747a..c15bdba 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: type: string required: false default: '' + endtoend_tags: + type: string + required: false + default: '' js: type: boolean default: false @@ -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" @@ -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 @@ -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" @@ -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"