Skip to content

Commit

Permalink
Run unit tests (barryvdh#1086)
Browse files Browse the repository at this point in the history
* Run unit tests

* Add scripts, cs fixer

* Update composer.json
  • Loading branch information
barryvdh authored Aug 16, 2020
1 parent abe044e commit 5d11919
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
}

0 comments on commit 5d11919

Please sign in to comment.