generated from open-southeners/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (50 loc) · 1.98 KB
/
tests.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
name: tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3, 8.4]
laravel: [11.*, 12.*]
dependency-version: [prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, exif, zstd, brotli, lz4
coverage: pcov
- name: 🏗 Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: 🏗 Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-composer-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-composer-laravel-${{ matrix.laravel }}-
- name: 📦 Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: 🧪 Execute tests
run: vendor/bin/phpunit -c phpunit.coverage.dist.xml
- name: 🚀 Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: php${{ matrix.php }}-laravel${{ matrix.laravel }}
files: ./clover.xml
fail_ci_if_error: true
# verbose: true