Run unit tests (#1086)

* Run unit tests

* Add scripts, cs fixer

* Update composer.json
This commit is contained in:
Barry vd. Heuvel 2020-08-16 19:09:44 +02:00 committed by GitHub
parent abe044eaf0
commit 5d11919868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 2 deletions

39
.github/workflows/run-tests.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Tests
on: [push, pull_request]
jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: [7.4, 7.3, 7.2]
laravel: [7.*, 6.*, 5.5.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 5.5.*
php: 7.4
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-progress
composer update --${{ matrix.dependency-version }} --prefer-dist --no-suggest --no-progress
- name: Execute Unit Tests
run: composer test

View File

@ -19,8 +19,9 @@
"symfony/finder": "^3|^4|^5"
},
"require-dev": {
"orchestra/testbench": "^3.5|^4.0|^5.0",
"phpunit/phpunit": "^6.0|^7.0|^8.5|^9.0"
"orchestra/testbench": "^3.5.11|^4.0|^5.0",
"phpunit/phpunit": "^6.0|^7.0|^8.5|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
"psr-4": {
@ -49,5 +50,10 @@
"Debugbar": "Barryvdh\\Debugbar\\Facade"
}
}
},
"scripts": {
"check-style": "phpcs -p --standard=PSR12 config/ resources/ src/ tests/",
"fix-style": "phpcbf -p --standard=PSR12 config/ resources/ src/ tests/",
"test": "phpunit"
}
}