-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MacPaw/develop
Init Release
- Loading branch information
Showing
25 changed files
with
935 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: | ||
- '7.4' | ||
- '8.0' | ||
- '8.1' | ||
coverage: ['none'] | ||
include: | ||
- description: 'Log Code Coverage' | ||
php: '8.1' | ||
coverage: 'xdebug' | ||
|
||
name: PHP ${{ matrix.php }} ${{ matrix.description }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/files | ||
key: ${{ matrix.php }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: ${{ matrix.coverage }} | ||
|
||
- name: Add PHPUnit matcher | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Set composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: composer phpunit | ||
if: matrix.coverage == 'none' | ||
|
||
- name: PHPUnit tests and Log Code coverage | ||
run: vendor/bin/phpunit --coverage-clover=coverage.xml | ||
if: matrix.coverage == 'xdebug' | ||
|
||
- name: Run codecov | ||
uses: codecov/codecov-action@v1 | ||
if: matrix.coverage == 'xdebug' | ||
with: | ||
file: './coverage.xml' | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "Create release" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- name: Install dependencies | ||
run: npm install && npm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git -D | ||
- name: Release | ||
env: | ||
GH_TOKEN: ${{ secrets.PACKAGIST_PUBLIC_RELEASE_GH }} | ||
GITHUB_TOKEN: ${{ secrets.PACKAGIST_PUBLIC_RELEASE_GH }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: gitleaks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
gitleaks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Run gitleaks | ||
uses: zricethezav/gitleaks-action@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Code style and static analysis | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: PHP-CS-Fixer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --no-interaction --prefer-dist | ||
|
||
- name: Run script | ||
run: composer code-style | ||
|
||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --no-interaction --prefer-dist | ||
|
||
- name: Run script | ||
run: composer phpstan | ||
|
||
composer-validate: | ||
name: Composer validate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --no-interaction --prefer-dist | ||
|
||
- name: Run script | ||
run: composer composer-validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/vendor/ | ||
/composer.lock | ||
/build/ | ||
/.phpunit.result.cache | ||
/package-lock.json | ||
/node_modules/ | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES", | ||
"BREAKING" | ||
] | ||
}, | ||
"writerOpts": { | ||
"commitsSort": [ | ||
"subject", | ||
"scope" | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md", | ||
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Contribute to BehatRedisContext | ||
|
||
Thank you for contributing! | ||
|
||
Before we can merge your Pull-Request here are some guidelines that you need to follow. | ||
These guidelines exist not to annoy you, but to keep the code base clean, | ||
unified and future proof. | ||
|
||
## Dependencies | ||
|
||
We're using [`composer/composer`](https://github.com/composer/composer) to manage dependencies | ||
|
||
## Coding Standard | ||
|
||
This project uses [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) to enforce coding standards. | ||
The coding standard rules are defined in the **phpcs.xml.dist** file (part of this repository). | ||
|
||
Your Pull-Request must be compliant with the said standard. | ||
To check your code you can run `composer run code-style`. This command will give you a list of violations in your code (if any). | ||
|
||
The most common errors can be automatically fixed just by running `composer run code-style-fix`. | ||
|
||
[coding standard homepage]: https://github.com/doctrine/coding-standard | ||
|
||
## Static analysing tools | ||
|
||
This project uses [PHPStan](https://github.com/phpstan/phpstan) to find errors in code without running it. | ||
The analyser configuration is defined in the **phpstan.neon.dist** file (part of this repository). | ||
|
||
Your Pull-Request must be compliant with PHPStan rules. | ||
To check your code you can run `composer run phpstan`. This command will give you a list of violations in your code (if any). | ||
|
||
If error can't be fixed you should add it to `ignoreErrors` in **phpstan.neon.dist** | ||
|
||
## Unit-Tests | ||
|
||
Please try to add a test for your pull-request. This project uses PHPUnit as testing framework. | ||
|
||
You can run the unit-tests by calling `composer run phpunit`. | ||
|
||
New features without tests can't be merged. | ||
|
||
## Issues and Bugs | ||
|
||
To create a new issue, you can use the GitHub issue tracking system. | ||
|
||
## Getting merged | ||
|
||
Please allow us time to review your pull requests. We will give our best to review | ||
everything as fast as possible, but cannot always live up to our own expectations. | ||
|
||
Pull requests without tests most probably will not be merged. | ||
Documentation PRs obviously do not require tests. | ||
|
||
Thank you very much again for your contribution! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
Symfony Behat Redis Context | ||
================================= | ||
|
||
| Version | Build Status | Code Coverage | | ||
|:---------:|:-------------:|:-----:| | ||
| `master`| [![CI][master Build Status Image]][master Build Status] | [![Coverage Status][master Code Coverage Image]][master Code Coverage] | | ||
| `develop`| [![CI][develop Build Status Image]][develop Build Status] | [![Coverage Status][develop Code Coverage Image]][develop Code Coverage] | | ||
|
||
Installation | ||
============ | ||
|
||
Step 1: Download the Bundle | ||
---------------------------------- | ||
Open a command console, enter your project directory and execute: | ||
|
||
### Applications that use Symfony Flex [in progress](https://github.com/MacPaw/BehatRedisContext/issues/2) | ||
|
||
```console | ||
$ composer require --dev macpaw/behat-redis-context | ||
``` | ||
|
||
### Applications that don't use Symfony Flex | ||
|
||
Open a command console, enter your project directory and execute the | ||
following command to download the latest stable version of this bundle: | ||
|
||
```console | ||
$ composer require --dev macpaw/behat-redis-context | ||
``` | ||
|
||
This command requires you to have Composer installed globally, as explained | ||
in the [installation chapter](https://getcomposer.org/doc/00-intro.md) | ||
of the Composer documentation. | ||
|
||
|
||
Then, enable the bundle by adding it to the list of registered bundles | ||
in the `app/AppKernel.php` file of your project: | ||
|
||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = array( | ||
// ... | ||
BehatRedisContextBundle\BehatRedisContextBundle::class => ['test' => true], | ||
); | ||
|
||
// ... | ||
} | ||
|
||
// ... | ||
} | ||
``` | ||
|
||
Create configuration for behat redis context: | ||
|
||
`config/packages/test/behat_redis_context.yaml ` | ||
```yaml | ||
behat_redis_context: | ||
dataFixturesPath: "" | ||
``` | ||
Step 2: Change path to directory with your fixtures | ||
---------------------------------- | ||
`config/packages/test/behat_redis_context.yaml ` | ||
```yaml | ||
behat_redis_context: | ||
dataFixturesPath: "your path" | ||
``` | ||
|
||
Step 3: Change path to directory with your fixtures | ||
---------------------------------- | ||
`config/services_test.yaml` | ||
```yaml | ||
Predis\ClientInterface: 'Your Redis Client' | ||
``` | ||
|
||
Example if you use [Symfony Redis Bundle](https://github.com/symfony-bundles/redis-bundle): | ||
```yaml | ||
Predis\ClientInterface: '@SymfonyBundles\RedisBundle\Redis\ClientInterface' | ||
``` | ||
|
||
Step 4: Configure Behat | ||
============= | ||
Go to `behat.yml` | ||
|
||
```yaml | ||
... | ||
contexts: | ||
- BehatRedisContextBundle\Context\RedisContext | ||
- BehatRedisContextBundle\Context\RedisFixturesContext | ||
... | ||
``` | ||
|
||
[master Build Status]: https://github.com/macpaw/BehatRedisContext/actions?query=workflow%3ACI+branch%3Amaster | ||
[master Build Status Image]: https://github.com/macpaw/BehatRedisContext/workflows/CI/badge.svg?branch=master | ||
[develop Build Status]: https://github.com/macpaw/BehatRedisContext/actions?query=workflow%3ACI+branch%3Adevelop | ||
[develop Build Status Image]: https://github.com/macpaw/BehatRedisContext/workflows/CI/badge.svg?branch=develop | ||
[master Code Coverage]: https://codecov.io/gh/macpaw/BehatRedisContext/branch/master | ||
[master Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/BehatRedisContext/master?logo=codecov | ||
[develop Code Coverage]: https://codecov.io/gh/macpaw/BehatRedisContext/branch/develop | ||
[develop Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/BehatRedisContext/develop?logo=codecov |
Oops, something went wrong.