Run tests on both MariaDB & MySQL

This commit is contained in:
Dane Everitt 2021-04-17 12:10:40 -07:00
parent f5ca391400
commit 1ebcb2b7fb
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -1,17 +1,25 @@
name: Run Test Suite name: run tests
on: on:
push: push:
branch-ignore: branches-ignore:
- 'master' - master
- 'release/**' - "release/**"
pull_request: pull_request:
jobs: jobs:
integration_tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')" if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
services: services:
mariadb:
image: mariadb:10.2
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: panel_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mysql: mysql:
image: mysql:5.7 image: mysql:8
env: env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: panel_test MYSQL_DATABASE: panel_test
@ -21,7 +29,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
php: [7.4, 8.0] php: [ 7.4, 8.0 ]
database: [ mysql, mariadb ]
name: PHP ${{ matrix.php }} name: PHP ${{ matrix.php }}
steps: steps:
- name: checkout - name: checkout
@ -59,9 +68,15 @@ jobs:
env: env:
DB_CONNECTION: testing DB_CONNECTION: testing
TESTING_DB_HOST: UNIT_NO_DB TESTING_DB_HOST: UNIT_NO_DB
- name: execute integration tests - name: execute integration tests (mysql)
run: vendor/bin/phpunit tests/Integration run: vendor/bin/phpunit tests/Integration
if: ${{ always() }} if: "${{ matrix.database }} == 'mysql'"
env: env:
TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }} TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }}
TESTING_DB_USERNAME: root TESTING_DB_USERNAME: root
- name: execute integration tests (mariadb)
run: vendor/bin/phpunit tests/Integration
if: "${{ matrix.database }} == 'mariadb'"
env:
TESTING_DB_PORT: ${{ job.services.mariadb.ports[3306] }}
TESTING_DB_USERNAME: root