Skip to content

Commit

Permalink
Update GitHub Actions for Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
laravel-shift committed Mar 1, 2024
1 parent dcb8faf commit 463a41b
Showing 1 changed file with 45 additions and 31 deletions.
76 changes: 45 additions & 31 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ name: Tests

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: [8.1]
php-versions: [8.1, '8.2']

name: PHP ${{ matrix.php-versions }} Test

services:
redis:
image: redis
Expand All @@ -24,32 +29,41 @@ jobs:
ports:
- 11211:11211
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: memcached
coverage: pcov
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: dump autoload
run: composer dump-autoload
- name: Run test suite
run: vendor/bin/phpunit
- name: Run cs
run: composer run-script phpcs
- name: Run analyse
run: composer run-script analyse
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: memcached
coverage: pcov

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: "steps.composer-cache.outputs.cache-hit != 'true'"
run: composer install --prefer-dist --no-progress --no-suggest

- name: dump autoload
run: composer dump-autoload

- name: Run test suite
run: vendor/bin/phpunit

- name: Run cs
run: composer run-script phpcs

- name: Run analyse
run: composer run-script analyse

0 comments on commit 463a41b

Please sign in to comment.