Skip to content

Commit ede4b2c

Browse files
authored
feat: run tests in github actions (#91)
1 parent f424ebc commit ede4b2c

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/php.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PHP
2+
3+
on: [push]
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 15
10+
fail-fast: false
11+
matrix:
12+
laravel-version: ['5.8.*', '^6.0', '^7.0']
13+
php-versions: ['7.2', '7.4']
14+
name: PHP ${{ matrix.php-versions }} on Laravel ${{ matrix.laravel-version }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@master
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@master
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extension-csv: mbstring, xdebug
23+
coverage: xdebug
24+
- name: Install dependencies
25+
run: |
26+
composer require --no-update --no-interaction "illuminate/support:${{ matrix.laravel-version }}"
27+
composer update --no-interaction --prefer-dist --no-suggest
28+
- name: Lint composer.json
29+
run: composer validate
30+
- name: Run Tests
31+
run: composer test:ci

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
}
3939
},
4040
"scripts": {
41-
"test": "vendor/bin/phpunit"
41+
"test": "vendor/bin/phpunit",
42+
"test:ci": "phpunit --verbose --coverage-clover=coverage.xml"
4243
},
4344
"config": {
4445
"sort-packages": true

0 commit comments

Comments
 (0)