-
-
Notifications
You must be signed in to change notification settings - Fork 175
67 lines (58 loc) · 1.58 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
63
64
65
66
67
name: Tests
on:
pull_request:
paths:
- 'config/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/tests.yml'
- 'composer.json'
push:
branches: ['main']
paths:
- 'config/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/tests.yml'
- 'composer.json'
workflow_dispatch:
jobs:
test:
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
runs-on: 'ubuntu-latest'
strategy:
matrix:
php:
- "8.1"
- "8.2"
- "8.3"
laravel:
- "9"
- "10"
- "11"
exclude:
- php: "8.1"
laravel: "11"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ctype, dom, grpc, json, mbstring, openssl, xml, zip, zlib
coverage: xdebug
- name: Install dependencies
run: |
composer require -W "illuminate/contracts:^${{ matrix.laravel }}.0"
composer require -W --dev orchestra/testbench
- name: Setup Problem Matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox
- name: Upload code coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}