diff --git a/action.yml b/action.yml index ef1747a..ee4c123 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: type: string required: false default: '' + endtoend_tag: + 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_TAG: ${{ 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_TAG" =~ ^[a-zA-Z0-9]*$ ]]; then + echo "Invalid input for endtoend_tag" + 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_TAG: ${{ inputs.endtoend_tag }} 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_TAG != "" ]]; then + vendor/bin/behat --colors --strict --config __behat.yml "$ENDTOEND_SUITE" --tags="$ENDTOEND_TAG" + else + vendor/bin/behat --colors --strict --config __behat.yml "$ENDTOEND_SUITE" + fi else - vendor/bin/behat --colors --strict --config __behat.yml + if [[ $ENDTOEND_TAG != "" ]]; then + vendor/bin/behat --colors --strict --config __behat.yml --tags="$ENDTOEND_TAG" + else + vendor/bin/behat --colors --strict --config __behat.yml + fi fi echo "Passed"