From dc6e36fff853bd3ab583045c7f79fb6b62e85ddc Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Fri, 24 Nov 2023 15:19:20 +0100 Subject: [PATCH] no-issue - CI - add MariaDB --- .github/workflows/continuous-integration.yml | 103 ++++++++++--------- 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 56ff46fc..756ab054 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -147,61 +147,72 @@ jobs: DBAL_ROOT_USER: "postgres" DBAL_USER: "postgres" DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/test_db?serverVersion=${{ matrix.postgres-version }}&charset=utf8" - run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" + run: "vendor/bin/phpunit" - # phpunit-mariadb: - # name: "PHPUnit with MariaDB" - # runs-on: "ubuntu-22.04" + phpunit-mariadb: + name: "PHPUnit with MariaDB" + runs-on: ubuntu-latest + container: + image: ghcr.io/makinacorpus/dbtoolsbundle-ci:main + needs: "phpunit-smoke-tests" - # strategy: - # matrix: - # php-version: - # - "8.1" - # - "8.2" - # - "8.3" - # mariadb-version: - # - "10.6" # LTS (Jul 2026) - # - "10.11" # LTS (Feb 2028) - # - "11.0" # STS (Jun 2024) - # - "11.1" # STS (Aug 2024) - # extension: - # - "mysqli" - # - "pdo_mysql" + strategy: + matrix: + php-version: + - "8.1" + mariadb-version: + - "10.6" # LTS (Jul 2026) + - "10.11" # LTS (Feb 2028) + - "11.0" # STS (Jun 2024) + - "11.1" # STS (Aug 2024) + extension: + - "mysqli" + - "pdo_mysql" - # services: - # mariadb: - # image: "mariadb:${{ matrix.mariadb-version }}" - # env: - # MYSQL_ALLOW_EMPTY_PASSWORD: yes - # MYSQL_DATABASE: "doctrine_tests" + services: + mariadb: + image: "mariadb:${{ matrix.mariadb-version }}" + env: + MARIADB_ROOT_PASSWORD: "password" + MYSQL_DATABASE: "test_db" - # options: >- - # --health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent" + options: >- + --health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent" - # ports: - # - "3306:3306" + ports: + - "3306:3306" - # steps: - # - name: "Checkout" - # uses: "actions/checkout@v4" - # with: - # fetch-depth: 2 + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + fetch-depth: 2 - # - name: "Install PHP" - # uses: "shivammathur/setup-php@v2" - # with: - # php-version: "${{ matrix.php-version }}" - # coverage: "pcov" - # ini-values: "zend.assertions=1" - # extensions: "${{ matrix.extension }}" + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + ini-values: "zend.assertions=1" + extensions: "${{ matrix.extension }}" - # - name: "Install dependencies with Composer" - # uses: "ramsey/composer-install@v2" - # with: - # composer-options: "--ignore-platform-req=php+" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + composer-options: "--ignore-platform-req=php+" - # - name: "Run PHPUnit" - # run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" + - name: "Run PHPUnit" + env: + DBAL_DRIVER: "${{ matrix.extension }}" + DBAL_DBNAME: "test_db" + DBAL_HOST: "mariadb" + DBAL_PASSWORD: "password" + DBAL_PORT: "3306" + DBAL_ROOT_PASSWORD: "password" + DBAL_ROOT_USER: "root" + DBAL_USER: "root" + DATABASE_URL: "mysql://root:password@mariadb11:3306/test_db" + + run: "vendor/bin/phpunit" # phpunit-mysql: # name: "PHPUnit with MySQL"