Behat is an open source Behavior Driven Development framework. What’s behavior driven development, you ask? It's a way to develop software through a constant communication with stakeholders in form of examples; examples of how this software should help them, and you, to achieve your goals.
Given I am on "https://github.com/php-actions/behat"
When I press "Star this repository"
Then I should be a stargazer of "php-actions/behat"
And I should see "Unstar this repository"
Create your Github Workflow configuration in .github/workflows/ci.yml or similar.
name: CI
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v3
- uses: php-actions/behat@v1
# ... then your own project steps ...This action is released with semantic version numbers, but also tagged to the latest major release's tag always points to the latest release within the matching major version.
Please feel free to use uses: php-actions/behat@v1 to always run the latest version of v1, or uses: php-actions/behat@v1.0.1 to specify an exact release.
We've put together an extremely simple example application that uses php-actions/behat. Check it out here: https://github.com/php-actions/example-behat.
The following configuration options are available:
versionWhat version of Behat to use (default: latest)php_versionWhat version of PHP to use (default: latest)php_extensionsSpace separated list of extensions to configure with the PHP buildvendored_behat_pathPath to a vendored behat binaryconfigConfiguration file locationpathsOptional path(s) to excludesuiteOnly execute a specific suiteformatHow to format tests output (pretty/progress/junit)outWrite format output to a file/directory instead of STDOUTnameOnly executeCall the feature elements which match part of the given name or regextagsOnly executeCall the features or scenarios with tags matching tag filter expressionroleOnly executeCall the features with actor role matching a wildcarddefinitionsPrint all available step definitions (l to list, i to show extended info, 'needle' to find specific definitions)memory_limitMemory limit for testsargsExtra arguments to pass to the behat binary
The syntax for passing in custom input is the following:
...
jobs:
behat:
...
- name: Behat tests
uses: php-actions/behat@v1
with:
config: path/to/behat.yml
memory_limit: 256MIf you require other configurations of Behat, please request them in the GitHub issue tracker.
It's possible to run any version of Behaty under any version of PHP, with any PHP extensions you require. This is configured with the following inputs:
version- the version number of Behat to run, e.g.3or3.11.0(default: latest)php_version- the version number of PHP to use, e.g.7.4(default: latest)php_extensions- a space-separated list of extensions to install using php-build, e.g.xdebug mbstring(default: N/A)
Please note the version number specified within your Action configuration must match your composer.json major version number. For example, if your composer.json requires behat/behat 3.11.0, you must use the version: 3.11.0 input, as major versions of PHPBehat are incompatible with each other.
If you require a specific version that is not compatible with GitHub Actions for some reason, please make a request in the GitHub issue tracker.
If you found this repository helpful, please consider sponsoring the developer.
