Skip to content

Commit

Permalink
New github workflow for laravel 11 (#5)
Browse files Browse the repository at this point in the history
Support Laravel 11 in github workflows.
  • Loading branch information
kfriars committed Apr 22, 2024
1 parent 041b5a4 commit 60030a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
php: [8.2, 8.3]
laravel: [^10, ^11]
stability: [prefer-lowest, prefer-stable]


name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -31,7 +39,9 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
Expand All @@ -43,13 +53,20 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3]
php: [8.3]
laravel: [^11]
stability: [prefer-stable]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -63,7 +80,9 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v5.0.0
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.8",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^8.8",
"nunomaduro/collision": "^8.1.1||^7.10.0",
"orchestra/testbench": "^9.0.0||^8.22.0",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
Expand Down

0 comments on commit 60030a9

Please sign in to comment.