Skip to content

composer.json

composer.json #4

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
php: [ 8.3, 8.4 ]
stability: [ prefer-lowest, prefer-stable ]
name: Test with php ${{ matrix.php }} on ${{ matrix.os }} - ${{ matrix.stability }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
# coverage: xdebug
- name: Get composer cache directory (Unix based)
if: runner.os != 'Windows'
id: composer-cache-unix
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Get composer cache directory (Windows)
if: runner.os == 'Windows'
id: composer-cache-windows
run: |
$dir = composer config cache-files-dir
echo "dir=$dir" >> $env:GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-unix.outputs.dir || steps.composer-cache-windows.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer update --no-interaction --prefer-dist --${{ matrix.stability }}
- name: Run tests
run: ./vendor/bin/pest