Skip to content

Add tests badge to README #9

Add tests badge to README

Add tests badge to README #9

Workflow file for this run

name: Tests
on:
push:
branches: [master, staging]
pull_request:
branches: [master, staging]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0]
database: [mysql, mariadb, sqlite]
release: [stable, lowest]
include:
- database: sqlite
pdo: sqlite
- database: mariadb
pdo: mysql
- database: mysql
pdo: mysql
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 3306
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 3306
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/cache@v3
with:
path: ~/.cache/composer/files
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: pecl
extensions: bcmath, ctype, json, mbstring, openssl, pdo, pdo_${{ matrix.pdo }}, tokenizer, xml
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }}
- run: |
composer test
env:
DATABASE: ${{ matrix.database }}
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
MARIADB_PORT: ${{ job.services.mariadb.ports[3306] }}