-
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 #2 from bearsunday/update-ci-qa
Supports PHP 8.0
- Loading branch information
Showing
17 changed files
with
348 additions
and
135 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,34 @@ | ||
# CONTRIBUTING | ||
|
||
## Code Contributions | ||
|
||
## Installation | ||
|
||
Install project dependencies and test tools by running the following commands. | ||
|
||
```bash | ||
$ composer install | ||
``` | ||
|
||
## Running tests | ||
|
||
```bash | ||
$ composer test | ||
``` | ||
```bash | ||
$ composer coverage // xdebug | ||
$ composer pcov // pcov | ||
``` | ||
|
||
Add tests for your new code ensuring that you have 100% code coverage. | ||
In rare cases, code may be excluded from test coverage using `@codeCoverageIgnore`. | ||
|
||
## Sending a pull request | ||
|
||
To ensure your PHP code changes pass the CI checks, make sure to run all the same checks before submitting a PR. | ||
|
||
```bash | ||
$ composer tests | ||
``` | ||
|
||
When you make a pull request, the tests will automatically be run again by GH action on multiple php versions. |
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,14 @@ | ||
--- | ||
name: Bug Report | ||
about: Create a bug report | ||
labels: Bug | ||
--- | ||
|
||
### Bug Report | ||
|
||
<!-- Provide a summary describing the problem you are experiencing. --> | ||
|
||
### How to reproduce | ||
|
||
<!--- Describe exactly how to reproduce the problem, using a minimal test-case or working code sample. --> | ||
|
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 @@ | ||
--- | ||
name: Feature | ||
about: Suggest a new feature or enhancement | ||
labels: Feature | ||
--- | ||
|
||
<!-- Write your suggestion here. --> |
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 @@ | ||
--- | ||
name: Question | ||
about: Ask a question regarding software usage | ||
labels: Support | ||
--- | ||
|
||
<!-- Write your question here. --> |
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,6 @@ | ||
# Reporting a vulnerability | ||
|
||
If you have found any issues that might have security implications, | ||
please send a report privately to [email protected] | ||
|
||
Do not report security reports publicly. |
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 @@ | ||
name: Coding Standards | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
coding-standards: | ||
name: Coding Standards | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
tools: cs2pr | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Validate composer.json | ||
run: composer validate --strict | ||
|
||
- name: Run PHP_CodeSniffer | ||
run: ./vendor/bin/phpcs -q --no-colors --report=checkstyle src tests | cs2pr |
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,61 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '42 15 * * *' | ||
|
||
jobs: | ||
phpunit: | ||
name: PHPUnit | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
operating-system: | ||
- ubuntu-latest | ||
php-version: | ||
- '7.3' | ||
- '7.4' | ||
- '8.0' | ||
dependencies: | ||
- lowest | ||
- highest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Setup PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
coverage: pcov | ||
ini-values: zend.assertions=1 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install lowest dependencies | ||
if: ${{ matrix.dependencies == 'lowest' }} | ||
run: composer update --prefer-lowest --no-interaction --no-progress --no-suggest | ||
|
||
- name: Install highest dependencies | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: composer update --no-interaction --no-progress --no-suggest | ||
|
||
- name: Run test suite | ||
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml | ||
|
||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml |
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,113 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
static-analysis-phpstan: | ||
name: Static Analysis with PHPStan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
tools: cs2pr | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Run PHPStan | ||
run: ./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction --error-format=checkstyle | cs2pr | ||
|
||
static-analysis-psalm: | ||
name: Static Analysis with Psalm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
tools: cs2pr | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Run Psalm | ||
run: ./vendor/bin/psalm --show-info=false --output-format=checkstyle --shepherd | cs2pr | ||
|
||
static-analysis-phpmd: | ||
name: Static Analysis with PHPMD | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --no-progress --prefer-dist | ||
|
||
static-analysis-composer-require-checker: | ||
name: Static Analysis with ComposerRequireChecker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer install --no-interaction --no-progress --prefer-dist | ||
composer require --dev maglnet/composer-require-checker ^3.0 | ||
- name: Run composer-require-checker | ||
run: ./vendor/bin/composer-require-checker check ./composer.json |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
/.phpunit.result.cache | ||
/.phpcs-cache | ||
/vendor/ | ||
/vendor-bin/tools/vendor/ | ||
/build/ | ||
/.idea/ | ||
|
||
/composer.lock | ||
/phpunit.xml | ||
/.phpunit.result.cache | ||
/.php_cs.cache | ||
.phpcs-cache | ||
composer.lock |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.