forked from matt-allan/laravel-code-style
-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (47 loc) · 1.56 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
name: Run Tests
on:
push:
branches:
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
phpunit:
name: PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']
laravel-version: [^10.0, ^11.0]
exclude:
- php-version: '8.1'
laravel-version: ^11.0
- php-version: '8.4'
laravel-version: ^10.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
- name: Validate Composer files
run: composer validate
- name: Update composer.json
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update --dev
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
- name: Check for style violations
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Clone the laravel skeleton
run: git clone https://github.com/laravel/laravel.git --single-branch --depth 1
- name: Run test suite
run: vendor/bin/phpunit