Skip to content

connections

connections #95

Workflow file for this run

name: Tests
on:
push:
branches:
- main
- '*.x'
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
name: PHP ${{ matrix.php }}
env:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, grpc
key: cache-v1 # can be any string, change to clear the extension cache.
DB_DATABASE: testbench
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MySQL
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: ${{ matrix.mysql }}
root-password: ''
my-cnf: |
innodb_log_file_size=256MB
innodb_buffer_pool_size=512MB
max_allowed_packet=16MB
max_connections=50
local_infile=1
log-output=NONE
slow-query-log=0
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=3M
innodb_buffer_pool_size=180M
innodb_doublewrite=0
datadir=/dev/shm/mysql
- name: Show MySQL Variables
run: mysql -uroot -h127.0.0.1 -e 'show variables'
- name: Create Database
run: |
mysql -uroot -h127.0.0.1 -e 'create database ${{ env.DB_DATABASE }};'
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
- name: Send to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: unittests
files: ./coverage.xml