diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ea173d6b..fdd572ec 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -211,60 +211,70 @@ jobs: DBAL_ROOT_USER: "root" DBAL_USER: "root" DATABASE_URL: "mysql://root:password@mariadb:3306/test_db" - run: "vendor/bin/phpunit" - # phpunit-mysql: - # name: "PHPUnit with MySQL" - # runs-on: "ubuntu-22.04" + phpunit-mysql: + name: "PHPUnit with MySQL" + 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" - # mysql-version: - # - "5.7" - # - "8.0" - # - "8.2" - # extension: - # - "mysqli" - # - "pdo_mysql" + strategy: + matrix: + php-version: + - "8.1" + mysql-version: + - "5.7" + - "8.0" + - "8.2" + extension: + - "mysqli" + - "pdo_mysql" - # services: - # mysql: - # image: "mysql:${{ matrix.mysql-version }}" + services: + mysql: + image: "mysql:${{ matrix.mysql-version }}" - # options: >- - # --health-cmd "mysqladmin ping --silent" - # -e MYSQL_ALLOW_EMPTY_PASSWORD=yes - # -e MYSQL_DATABASE=doctrine_tests + options: >- + --health-cmd "mysqladmin ping --silent" + -e MYSQL_ROOT_PASSWORD=password + -e MYSQL_DATABASE=test_db - # 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 }}" + coverage: "pcov" + 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: "mysql" + DBAL_PASSWORD: "password" + DBAL_PORT: "3306" + DBAL_ROOT_PASSWORD: "password" + DBAL_ROOT_USER: "root" + DBAL_USER: "root" + DATABASE_URL: "mysql://root:password@mysql:3306/test_db" + run: "vendor/bin/phpunit" # phpunit-mssql: # name: "PHPUnit with SQL Server" diff --git a/dev.sh b/dev.sh index 1abf4226..c3a651f7 100755 --- a/dev.sh +++ b/dev.sh @@ -90,7 +90,7 @@ do_test_mariadb11() { -e DBAL_ROOT_PASSWORD="password" \ -e DBAL_ROOT_USER="root" \ -e DBAL_USER=root \ - -e DATABASE_URL=mysql://root:password@mariadb11:3306/test_db?serverVersion=11.1.3-MariaDB \ + -e DATABASE_URL=mysql://root:password@mariadb11:3306/test_db \ phpunit vendor/bin/phpunit $@ } diff --git a/tests/TestKernel.php b/tests/TestKernel.php index ace590eb..3a3be612 100644 --- a/tests/TestKernel.php +++ b/tests/TestKernel.php @@ -27,6 +27,7 @@ public function __construct(string $environment, bool $debug) $filesystem->mkdir($this->testRootDir . '/vendor'); $filesystem->mkdir($this->testRootDir . '/var/cache'); + $filesystem->mkdir($this->testRootDir . '/var/db_tools'); parent::__construct($environment, $debug); }