destructr/.github/workflows/test.yml
Joby Elliott f9a95898d4
Test overhaul (#2)
* first attempt at PHPUnit tests in github actions

* composer ignore platform deps

* another try

* plumbing

* pdo auth

* more plumbing

* doing env variables right

* will this work?

* calling phpunit directly

* don't specify test

* export

* bug fix

* trying something

* trying another thing

* trying again

* trying it right

* might work this time

* testing can't work on 7.0
2022-05-27 10:44:41 -06:00

46 lines
1.3 KiB
YAML

name: Test suite
on: push
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php: ["7.1", "7.2", "7.3", "7.4"]
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: destructr_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mariadb:
image: mariadb:10.2
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: destructr_test
ports:
- 3306
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Composer install
run: composer install -o --no-progress --ignore-platform-reqs
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql
coverage: none
ini-values: variables_order=EGPCS
- name: PHPUnit
env:
TEST_MYSQL_SERVER: 127.0.0.1
TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
TEST_MARIADB_SERVER: 127.0.0.1
TEST_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
run: ./vendor/bin/phpunit