From 463a41bab3469e525ab492e68f04fa1f20783fdc Mon Sep 17 00:00:00 2001 From: Shift Date: Fri, 1 Mar 2024 23:32:11 +0000 Subject: [PATCH] Update GitHub Actions for Laravel 11 --- .github/workflows/php.yml | 76 +++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 12d60c8..788f448 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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 @@ -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