Skip to content

tests

tests #618

Workflow file for this run

name: tests
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
tests:
runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:5.7
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: forge
# ports:
# - 33306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.2']
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
coverage: xdebug
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --coverage-clover coverage.xml
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
- name: Upload coverage to Codecov
if: ${{ github.ref == 'refs/heads/master' && matrix.php == '8.1' && matrix.stability == 'prefer-stable' }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml