Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Release #3

Merged
merged 25 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0cc2caa
feat: add gitignore
Yozhef Jan 11, 2022
bac0e99
feat: add contributing doc
Yozhef Jan 11, 2022
b977fc1
feat: add security policy
Yozhef Jan 11, 2022
68675a4
feat: add static-analysis gitHub action
Yozhef Jan 11, 2022
9b87796
feat: add gitleaks gitHub action
Yozhef Jan 11, 2022
dad4364
feat: add create release config gitHub action
Yozhef Jan 11, 2022
abfe816
feat: add ci config gitHub action
Yozhef Jan 11, 2022
e61ee9c
fix: change master to main in gitHub actions
Yozhef Jan 11, 2022
c85c1df
fix: add release config conventionalcommits
Yozhef Jan 11, 2022
67ce12e
feat: add commit lint config
Yozhef Jan 11, 2022
70fe07e
feat: init library Behat Redis Context
Yozhef Jan 11, 2022
4f302aa
feat: add config phpunit
Yozhef Jan 11, 2022
72dd59c
feat: add code style config
Yozhef Jan 11, 2022
1d40131
feat: add package
Yozhef Jan 11, 2022
6f80d1f
feat: add config phpstan
Yozhef Jan 11, 2022
2c85d20
feat: add test Configuration bundle
Yozhef Jan 12, 2022
7bf33d0
feat: update after code review
Yozhef Jan 12, 2022
c48df17
feat: add redmi
Yozhef Jan 12, 2022
25fedf6
Update README.md
Yozhef Jan 12, 2022
b52b950
feat: add redmi behat config
Yozhef Jan 12, 2022
ec643e8
Merge remote-tracking branch 'origin/feat/init' into feat/init
Yozhef Jan 12, 2022
b0524c8
feat: add redmi behat config
Yozhef Jan 12, 2022
894800b
Merge pull request #1 from MacPaw/feat/init
Yozhef Jan 12, 2022
1044192
feat: update readme
Yozhef Jan 13, 2022
9f9a30c
Merge pull request #4 from MacPaw/feat/init
Yozhef Jan 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yaml
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
26 changes: 26 additions & 0 deletions .github/workflows/create-release.yml
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
16 changes: 16 additions & 0 deletions .github/workflows/gitleaks.yaml
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
55 changes: 55 additions & 0 deletions .github/workflows/static-analysis.yaml
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
7 changes: 7 additions & 0 deletions .gitignore
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/
41 changes: 41 additions & 0 deletions .releaserc
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"
}
]
]
}
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
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!
108 changes: 108 additions & 0 deletions README.md
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
Loading