Skip to content

Set up basic project workflow #1

Set up basic project workflow

Set up basic project workflow #1

Workflow file for this run

name: PHPUnit
on:
push:
pull_request:
schedule:
- cron: '0 14 * * 3' # Run Wednesdays at 2pm EST
jobs:
php-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.1, 8.2, 8.3 ]
laravel: [ ^9.0, ^10.0, ^11.0 ]
dependency-version: [ stable, lowest ]
exclude:
- laravel: ^11.0
php: 8.1
- laravel: ^9.0
dependency-version: lowest
name: "${{ matrix.php }} / ${{ matrix.laravel }} (${{ matrix.dependency-version }})"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv
tools: composer:v2
- name: Register composer cache directory
id: composer-cache-files-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
vendor
${{ steps.composer-cache-files-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_DISCARD_CHANGES: true
run: |
composer config minimum-stability ${{ matrix.minimum-stability }}
composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:${{ matrix.laravel }}"
composer update --no-progress --no-interaction --prefer-dist --with-all-dependencies --prefer-${{ matrix.dependency-version }}
- name: Execute tests
run: vendor/bin/phpunit