Skip to content

Build

Build #2014

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 0 * * *"
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist -o -n"
jobs:
tests:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2']
os: [ubuntu-latest, windows-latest, macos-latest]
dependencies: [locked]
experimental: [false]
name: PHP ${{ matrix.php-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Determine composer cache directory
id: determine-composer-cache-directory
run: 'echo "::set-output name=directory::$(composer config cache-dir)"'
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
key: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, fileinfo
coverage: none
ini-values: "memory_limit=-1"
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install highest dependencies from composer.json
if: matrix.dependencies == 'highest'
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}
- name: Install lowest dependencies from composer.json
if: matrix.dependencies == 'lowest'
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest
- name: Install dependencies from composer.lock
if: matrix.dependencies == 'locked'
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer install ${{ env.COMPOSER_FLAGS }}
- name: Install Laravel
run: composer require laravel/framework --no-update
- name: Run tests
run: vendor/bin/phpunit