Skip to content

update github action #3

update github action

update github action #3

Workflow file for this run

name: Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * *' # Run daily at midnight
env:
COMPOSER_PROCESS_TIMEOUT: 0
COMPOSER_NO_INTERACTION: 1
COMPOSER_NO_AUDIT: 1
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3, 8.4]
laravel: [11.*, 12.*]
stability: [prefer-lowest, prefer-stable]
exclude:
# Skip incompatible PHP versions and Laravel versions
- php: 8.2
laravel: 12.*
- php: 8.4
stability: prefer-lowest
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, exif, iconv
coverage: xdebug
ini-values: error_reporting=E_ALL
tools: composer:v2
- name: Setup problem matchers
run: |
echo "::add-matcher::/opt/hostedtoolcache/php.json"
echo "::add-matcher::/opt/hostedtoolcache/phpunit.json"
shell: /usr/bin/bash -e {0}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: /home/runner/.cache/composer/files
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}-${{ matrix.stability }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}-
${{ runner.os }}-composer-${{ matrix.php }}-
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Run PHPUnit tests
run: vendor/bin/phpunit --coverage-text
- name: Run PHP Static Analysis
run: |
if [ -f vendor/bin/phpstan ]; then
vendor/bin/phpstan analyse
fi