Skip to content

PHP Composer

PHP Composer #157

Workflow file for this run

name: PHP Composer
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '3 14 * * *'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2, 8.3]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
with:
php-version: ${{ matrix.php }}
extensions: curl
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Get Composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.stability }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.stability }}-
- name: Install dependencies
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Run tests
run: vendor/bin/phpunit --display-deprecation