Skip to content

Commit

Permalink
Docker environment (#32)
Browse files Browse the repository at this point in the history
* Use Docker containers for local tests run

* Run tests under Mysql 8.0
  • Loading branch information
misantron committed Jun 8, 2023
1 parent 99143e0 commit 2df0707
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build.yml
Expand Up @@ -28,24 +28,24 @@ jobs:
matrix:
operating-system:
- ubuntu-latest
db-version:
- '5.7'
- '8.0'
php-versions:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
services:
mysql:
image: mysql:5.7
image: "mysql:${{ matrix.db-version }}"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: dbunit
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
--health-cmd="mysqladmin ping --silent"
ports:
- 3306
- '3406:3306'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -62,8 +62,6 @@ jobs:
composer-options: --no-ansi --no-interaction --no-progress
- name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
env:
MYSQL_DB_PORT: ${{ job.services.mysql.ports[3306] }}
coverage:
name: Tests coverage
runs-on: ubuntu-latest
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,10 @@
version: 3.x

services:
mysql:
image: mysql:5.7
environment:
MYSQL_DATABASE: dbunit
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- '3406:3306'
2 changes: 1 addition & 1 deletion phpunit.xml
Expand Up @@ -22,7 +22,7 @@

<php>
<env name="MYSQL_DB_HOST" value="127.0.0.1"/>
<env name="MYSQL_DB_PORT" value="3306"/>
<env name="MYSQL_DB_PORT" value="3406"/>
<env name="MYSQL_DB_NAME" value="dbunit"/>
<env name="MYSQL_DB_USER" value="root"/>
<env name="MYSQL_DB_PASSWORD" value=""/>
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Metadata/AbstractMetadata.php
Expand Up @@ -155,7 +155,7 @@ public function quoteSchemaObject($object)
}

/**
* Seperates the schema and the table from a fully qualified table name.
* Separates the schema and the table from a fully qualified table name.
*
* Returns an associative array containing the 'schema' and the 'table'.
*
Expand Down

0 comments on commit 2df0707

Please sign in to comment.