-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (70 loc) · 2.76 KB
/
test-runner.yml
File metadata and controls
84 lines (70 loc) · 2.76 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
name: Tests
on:
# Run testing on all push and pull requests that have committed changes in PHP files
push:
paths:
- '**/*.php'
pull_request:
paths:
- '**/*.php'
# Make it possible to run the workflow manually
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
# Define the matrix of different PHP, Laravel, and testbench versions
strategy:
# Fail the whole workflow if one of the jobs fails
fail-fast: true
matrix:
php: [ 8.3, 8.4, 8.5 ]
laravel: [ 11.*, 12.* ]
dependency-version: [ prefer-stable ]
include:
# Laravel 12 uses Orchestra Testbench 10
- laravel: 12.*
testbench: 10.*
# Laravel 11 uses Orchestra Testbench 9
- laravel: 11.*
testbench: 9.*
name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}
steps:
#- name: Configure operating system
# run: sudo apt-get update && sudo apt-get install -y locales locales-all
- name: Checkout code
uses: actions/checkout@v6.0.2
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5.0.5
with:
path: vendor
key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: mbstring, gd, intl, pcntl
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction --no-scripts
- name: Setup testbench environment
run: |
cp workbench/.env.example workbench/.env
sed -i 's/APP_KEY=/APP_KEY=base64:ZQvPGC7uVADkjOgtGIIuCI8u3\/Pzu+VaRObIbHsgjCc=/' workbench/.env
sed -i 's/APP_ENV=local/APP_ENV=testing/' workbench/.env
grep "APP_KEY=base64:" workbench/.env
npm install
php vendor/bin/testbench vendor:publish --tag='filament-shield-config'
php vendor/bin/testbench filament:assets
php vendor/bin/testbench package:sync-skeleton
- name: Run test suite
run: vendor/bin/pest --ci --parallel