-
-
Notifications
You must be signed in to change notification settings - Fork 7
143 lines (130 loc) · 4.55 KB
/
Copy pathrun-tests.yml
File metadata and controls
143 lines (130 loc) · 4.55 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: run-tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- php: 8.2
laravel: 11.*
filament: 4.*
testbench: 9.*
livewire: ^3.0
pest: ^3.8
pest_plugin_laravel: ^3.1
pest_plugin_livewire: ^3.1
- php: 8.2
laravel: 12.*
filament: 4.*
testbench: 10.*
livewire: ^3.0
pest: ^3.8
pest_plugin_laravel: ^3.1
pest_plugin_livewire: ^3.1
- php: 8.3
laravel: 12.*
filament: 5.*
testbench: 10.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
- php: 8.4
laravel: 12.*
filament: 5.*
testbench: 10.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
- php: 8.5
laravel: 12.*
filament: 5.*
testbench: 10.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
- php: 8.3
laravel: 13.*
filament: 5.*
testbench: 11.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
- php: 8.4
laravel: 13.*
filament: 5.*
testbench: 11.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
- php: 8.5
laravel: 13.*
filament: 5.*
testbench: 11.*
livewire: ^4.0
pest: ^4.0
pest_plugin_laravel: ^4.0
pest_plugin_livewire: ^4.0
name: P${{ matrix.php }} - L${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer dependencies
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.filament }}-${{ matrix.testbench }}-${{ matrix.livewire }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.filament }}-${{ matrix.testbench }}-${{ matrix.livewire }}-
${{ runner.os }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, pcov
coverage: pcov
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
env:
XDEBUG_MODE: off
run: |
composer require \
"laravel/framework:${{ matrix.laravel }}" \
"orchestra/testbench:${{ matrix.testbench }}" \
"filament/filament:${{ matrix.filament }}" \
"livewire/livewire:${{ matrix.livewire }}" \
"pestphp/pest:${{ matrix.pest }}" \
"pestphp/pest-plugin-laravel:${{ matrix.pest_plugin_laravel }}" \
"pestphp/pest-plugin-livewire:${{ matrix.pest_plugin_livewire }}" \
--no-interaction --no-update --no-progress --ansi
composer update --prefer-stable --prefer-dist --no-interaction --no-progress --ansi
- name: Prepare coverage directory
run: mkdir -p build/logs
- name: Execute tests with coverage
run: vendor/bin/pest --coverage --coverage-clover build/logs/clover.xml
- name: Sanitize artifact name
run: |
LARAVEL_SAFE=$(echo "${{ matrix.laravel }}" | tr '*' 'x')
FILAMENT_SAFE=$(echo "${{ matrix.filament }}" | tr '*' 'x')
echo "ARTIFACT_NAME=coverage-${{ matrix.php }}-${LARAVEL_SAFE}-${FILAMENT_SAFE}" >> $GITHUB_ENV
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/logs/clover.xml
if-no-files-found: error