From 1ebcb2b7fb50459e2165046b653759e95cfb639d Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 17 Apr 2021 12:10:40 -0700 Subject: [PATCH] Run tests on both MariaDB & MySQL --- .github/workflows/tests.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d47663334..8c1738075 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,17 +1,25 @@ -name: Run Test Suite +name: run tests on: push: - branch-ignore: - - 'master' - - 'release/**' + branches-ignore: + - master + - "release/**" pull_request: jobs: - integration_tests: + tests: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')" 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: - image: mysql:5.7 + image: mysql:8 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: panel_test @@ -21,7 +29,8 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 8.0] + php: [ 7.4, 8.0 ] + database: [ mysql, mariadb ] name: PHP ${{ matrix.php }} steps: - name: checkout @@ -59,9 +68,15 @@ jobs: env: DB_CONNECTION: testing TESTING_DB_HOST: UNIT_NO_DB - - name: execute integration tests + - name: execute integration tests (mysql) run: vendor/bin/phpunit tests/Integration - if: ${{ always() }} + if: "${{ matrix.database }} == 'mysql'" env: TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }} 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