-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (65 loc) · 2.41 KB
/
phpunit.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Phpunit
on: [push, pull_request]
jobs:
phpcs:
runs-on: ubuntu-latest
name: phpcs - PHP 8.4
steps:
- name: Checkout repo
uses: actions/checkout@v3
# Setup the PHP version to use.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
# Dependencies needed for the shiftonelabs/codesniffer-standard package.
- name: Install dependencies
run: composer update --prefer-dist --no-interaction
# Run the phpcs tool.
- name: Run phpcs
run: ./vendor/bin/phpcs
tests:
runs-on: ${{ matrix.os }}
strategy:
# Turn off fail-fast so that all jobs will run even when one fails,
# and the build will still get marked as failed.
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.0', '8.1', '8.2', '8.3', '8.4']
laravel: ['9.*', '10.*', '11.*']
exclude:
- php: '8.0'
laravel: '10.*'
- php: '8.0'
laravel: '11.*'
- php: '8.1'
laravel: '11.*'
name: tests - PHP ${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
# We need more than 1 commit to prevent the "Failed to retrieve
# commit parents" error from the ocular code coverage upload.
fetch-depth: 5
# Setup the PHP version to use for the test and include xdebug to generate the code coverage file.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
# Setup the required packages for the version being tested and install the packages
- name: Install dependencies
run: |
COMPOSER_MEMORY_LIMIT=-1 composer require "illuminate/database:${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction
# Run the unit tests and generate the code coverage file.
- name: Run phpunit tests
run: ./vendor/bin/phpunit --coverage-clover ./clover.xml
# Send the code coverage file regardless of the tests passing or failing.
- name: Send coverage
if: success() || failure()
run: |
composer global require scrutinizer/ocular
~/.composer/vendor/bin/ocular code-coverage:upload --format=php-clover ./clover.xml