-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (47 loc) · 1.55 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Main
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1 ]
laravel: [ 10.* ]
dependency-version: [ prefer-lowest, prefer-stable ]
exclude:
- php: 8.1
laravel: 11.*
name: Tests PHP${{ matrix.php }} - Laravel v${{ matrix.laravel }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring, zip
coverage: none
- name: Cache Composer Dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-L${{ matrix.laravel }}-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }}
- name: Copy Environment Files
run: |
php -r "file_exists('.env.testing') || copy('.env.ci', '.env.testing');"
php -r "file_exists('.env') || copy('.env.ci', '.env');"
- name: Install Composer Dependencies
run: composer install --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run PHPUnit Tests
run: vendor/bin/phpunit --log-junit phpunit-report.xml
- name: Upload PHPUnit Report
uses: actions/upload-artifact@v2
with:
name: PHPUnit Test Report
path: phpunit-report.xml