-
Notifications
You must be signed in to change notification settings - Fork 372
50 lines (48 loc) · 1.74 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
name: Tests
on:
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.3, 8.2]
laravel: [11.*, 10.*]
dependency-version: [prefer-stable]
testsuite: [core, admin, shipping, stripe]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
name: ${{ matrix.testsuite }} - PHP ${{ matrix.php }} - L${{ matrix.laravel }} ${{ matrix.dependency-version == 'prefer-lowest' && '↓' || '↑' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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: composer-p${{ matrix.php }}-l${{ matrix.laravel }}-${{ hashFiles('composer.json') }}
restore-keys: composer-p${{ matrix.php }}-l${{ matrix.laravel }}-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-update
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist
- name: Execute tests
env:
APP_ENV: testing
DB_CONNECTION: testing
DB_DATABASE: ":memory:"
run: ./vendor/bin/pest --testsuite ${{ matrix.testsuite }}