Skip to content

Merge pull request #37 from spiral-packages/hotifx/heap #29

Merge pull request #37 from spiral-packages/hotifx/heap

Merge pull request #37 from spiral-packages/hotifx/heap #29

Workflow file for this run

name: run-tests
on:
pull_request: null
push:
branches:
- '*.*'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ '8.1', '8.2', '8.3' ]
mysql: [ 8.0 ]
stability: [ prefer-lowest, prefer-stable ]
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
services:
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: spiral
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 13306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Validate Composer
run: composer validate
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer
- name: Install Dependencies
uses: nick-invision/[email protected]
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit