Skip to content

Commit

Permalink
no-issue - CI - add MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMellerin committed Nov 24, 2023
1 parent ff3eca2 commit 0574683
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 45 deletions.
98 changes: 54 additions & 44 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
}

Expand Down
1 change: 1 addition & 0 deletions tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0574683

Please sign in to comment.