Skip to content

Commit 584fc4a

Browse files
author
farhadzand
committed
update github action
1 parent a9785b2 commit 584fc4a

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@ jobs:
1717
tests:
1818
runs-on: ubuntu-latest
1919
strategy:
20-
fail-fast: false
20+
fail-fast: true
2121
matrix:
2222
php: [8.2, 8.3, 8.4]
2323
laravel: [11.*, 12.*]
24+
stability: [prefer-lowest, prefer-stable]
2425
exclude:
26+
# Skip incompatible PHP versions and Laravel versions
2527
- php: 8.2
2628
laravel: 12.*
29+
- php: 8.4
30+
stability: prefer-lowest
2731

28-
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
32+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}
2933

3034
steps:
3135
- name: Checkout code
@@ -46,24 +50,28 @@ jobs:
4650
echo "::add-matcher::/opt/hostedtoolcache/phpunit.json"
4751
shell: /usr/bin/bash -e {0}
4852

49-
- name: Cache Composer dependencies
53+
- name: Get composer cache directory
5054
id: composer-cache
51-
uses: actions/cache@v4
55+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
56+
57+
- name: Cache dependencies
58+
uses: actions/cache@v3
5259
with:
53-
path: vendor
54-
key: ${{ runner.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
60+
path: ${{ steps.composer-cache.outputs.dir }}
61+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}-${{ matrix.stability }}
5562
restore-keys: |
56-
${{ runner.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}-
57-
${{ runner.os }}-php${{ matrix.php }}-
58-
${{ runner.os }}-
63+
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}-
64+
${{ runner.os }}-composer-${{ matrix.php }}-
5965
6066
- name: Install dependencies
61-
run: composer install --prefer-dist --no-interaction --no-progress --no-suggest
67+
run: |
68+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
69+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
6270
6371
- name: Run PHPUnit tests
6472
run: vendor/bin/phpunit --coverage-text
6573

66-
- name: Run PHPStan
74+
- name: Run PHP Static Analysis
6775
run: |
6876
if [ -f vendor/bin/phpstan ]; then
6977
vendor/bin/phpstan analyse

0 commit comments

Comments
 (0)