-
Notifications
You must be signed in to change notification settings - Fork 10
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 #132 from alps-asd/github
Add GH template and update CI
- Loading branch information
Showing
14 changed files
with
282 additions
and
197 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 akihito.koriyama@gmail.com | ||
|
||
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 |
---|---|---|
@@ -1,44 +1,41 @@ | ||
name: "Coding Standards" | ||
name: Coding Standards | ||
|
||
on: | ||
["pull_request", "push", "workflow_dispatch"] | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standards" | ||
name: Coding Standards | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Setup PHP ${{ matrix.php-version }}" | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
tools: phpcs, cs2pr | ||
php-version: 8.0 | ||
tools: cs2pr | ||
coverage: none | ||
|
||
- name: "Get composer cache directory" | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: "Cache composer dependencies" | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: "${{ steps.composer-cache.outputs.dir }}" | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: "Install dependencies with Composer" | ||
run: | | ||
composer install --no-interaction --no-progress --prefer-dist | ||
composer global require --dev doctrine/coding-standard ^8.1 | ||
- 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: "phpcs --standard=./phpcs.xml --report=checkstyle -q src tests | cs2pr" | ||
- 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 |
---|---|---|
@@ -1,59 +1,66 @@ | ||
name: "Continuous Integration" | ||
name: Continuous Integration | ||
|
||
on: | ||
["pull_request", "push", "workflow_dispatch"] | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
phpunit: | ||
name: "PHPUnit" | ||
name: PHPUnit | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
operating-system: | ||
- ubuntu-latest | ||
php-version: | ||
- "7.3" | ||
- "7.4" | ||
- "8.0" | ||
- "8.1" | ||
deps: | ||
- "normal" | ||
include: | ||
- deps: "low" | ||
php-version: "7.4" | ||
|
||
- '7.3' | ||
- '7.4' | ||
- '8.0' | ||
- '8.1' | ||
dependencies: | ||
- lowest | ||
- highest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: "Setup PHP ${{ matrix.php-version }}" | ||
- name: Setup PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
php-version: ${{ matrix.php-version }} | ||
coverage: pcov | ||
ini-values: zend.assertions=1 | ||
|
||
- name: "Get composer cache directory" | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: "Cache composer dependencies" | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: "${{ steps.composer-cache.outputs.dir }}" | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: "Install dependencies with Composer" | ||
run: "composer install --no-interaction --no-progress --prefer-dist" | ||
- name: Install lowest dependencies | ||
if: ${{ matrix.dependencies == 'lowest' }} | ||
run: composer update --prefer-lowest --no-interaction --no-progress | ||
|
||
- name: "Update lowest dependencies with Composer" | ||
run: "composer update --prefer-dist --prefer-lowest" | ||
if: "${{ matrix.deps == 'low' }}" | ||
- name: Install highest dependencies | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: composer update --no-interaction --no-progress | ||
|
||
- name: "Run PHPUnit" | ||
run: "./vendor/bin/phpunit" | ||
- 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 | ||
|
||
- name: "Run demo (JSON)" | ||
run: "bin/asd docs/blog/profile.json && bin/asd docs/todomvc/profile.json && bin/asd --and-tag=a,b --or-tag=c --color=red docs/blog/profile.json" | ||
- name: Run demo (JSON) | ||
run: bin/asd docs/blog/profile.json && bin/asd docs/todomvc/profile.json && bin/asd --and-tag=a,b --or-tag=c --color=red docs/blog/profile.json | ||
|
||
- name: "Run demo (XML)" | ||
run: "bin/asd docs/blog/profile.xml" | ||
- name: Run demo (XML) | ||
run: bin/asd docs/blog/profile.xml |
Oops, something went wrong.