Skip to content

Commit ed7b30c

Browse files
author
David Bohn
committed
Add test workflow
1 parent 93affe1 commit ed7b30c

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Thanks Freek Van der Herten (https://freek.dev/1546-using-github-actions-to-run-the-tests-of-laravel-projects-and-packages)
2+
name: Run tests
3+
4+
on:
5+
push:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
php-tests:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
php: [7.4, 7.3, 7.2]
16+
laravel: [6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
17+
dependency-version: [prefer-lowest, prefer-stable]
18+
os: [ubuntu-latest]
19+
include:
20+
- laravel: 6.*
21+
testbench: 4.*
22+
- laravel: 5.8.*
23+
testbench: 3.8.*
24+
- laravel: 5.7.*
25+
testbench: 3.7.*
26+
- laravel: 5.6.*
27+
testbench: 3.6.*
28+
- laravel: 5.5.*
29+
testbench: 3.5.*
30+
exclude:
31+
- laravel: 5.7.*
32+
php: 7.4
33+
- laravel: 5.6.*
34+
php: 7.4
35+
- laravel: 5.5.*
36+
php: 7.4
37+
38+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v1
43+
44+
- name: Setup PHP
45+
uses: shivammathur/setup-php@v1
46+
with:
47+
php-version: ${{ matrix.php }}
48+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
49+
coverage: none
50+
51+
- name: Install dependencies
52+
run: |
53+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
54+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
55+
56+
- name: Execute tests
57+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)