Skip to content

Commit

Permalink
Merge pull request #31 from creative-commoners/pulls/1/tag
Browse files Browse the repository at this point in the history
NEW Add endtoend_tag param
  • Loading branch information
GuySartorelli authored Jul 18, 2024
2 parents 6367845 + 99472fb commit 8ca12d4
Showing 1 changed file with 20 additions and 2 deletions.
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

0 comments on commit 8ca12d4

Please sign in to comment.