Skip to content

Commit

Permalink
[TASK] Add github action for testing
Browse files Browse the repository at this point in the history
This also includes issue templates for bug reports and feature requests.
  • Loading branch information
o-ba committed Dec 3, 2020
1 parent 774e005 commit e2c0937
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Summary / Description

Short description of the bug.

## Version

Version in which the bug occurs.

## Steps to reproduce

How one can reproduce the issue - **this is very important**

## Expected behaviour

What you expected to happen.

## Actual behavior

What actually happens.

### Additional

**Possible fix**

If you can, link to the line of code that might be responsible
for the problem or create a pull request if you have created
the fix already.

***Miscellaneous***

Add any other information like screenshots. You can also paste
any relevant logs. Please use code blocks (```) to format console
output, logs, and code as it's very hard to read otherwise.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary / Description

Summarize your idea for a new feature.

## Describe the solution you'd like

A clear and concise description of what you want to happen.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or
features you've considered.

## Possible solution

If you can provide the feature by yourself, please either
include the corresponding code or even better create a
pull request.

If you paste code, please use code blocks (```) for formatting
since it's otherwise very hard to read.
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests
on: [push, pull_request]
jobs:
tests:
name: Tests with PHP${{ matrix.php }}
runs-on: ubuntu-20.04
strategy:
matrix:
php: [7.2, 7.3, 7.4]
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: zip

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader

- name: Run Tests
run: |
composer tests:unit
composer cs
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"sort-packages": true
},
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-json": "*",
"ext-zip": "*",
"symfony/console": "^5.1",
Expand All @@ -27,7 +27,7 @@
"symfony/mime": "^5.1"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
"phpunit/phpunit": "^8.5",
"typo3/coding-standards": "^0.2.0"
},
"bin": [
Expand All @@ -48,7 +48,7 @@
"@php vendor/bin/phpunit --testsuite Unit"
],
"cs": [
"@php vendor/bin/php-cs-fixer fix --config=vendor/typo3/coding-standards/templates/extension_php_cs.dist src/ tests/"
"@php vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --config=vendor/typo3/coding-standards/templates/extension_php_cs.dist src/ tests/"
]
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Validation/VersionValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class VersionValidatorTest extends TestCase
* @param string $input
* @param bool $expected
*/
public function isValidTest(string$input, bool $expected): void
public function isValidTest(string $input, bool $expected): void
{
self::assertEquals($expected, (new VersionValidator())->isValid($input));
}
Expand Down

0 comments on commit e2c0937

Please sign in to comment.