-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from facile-it/functional-tests-and-dbal2.11-fix
Fix for DBAL 2.11 and functional tests
- Loading branch information
Showing
25 changed files
with
505 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/composer.lock export-ignore | ||
/tests export-ignore | ||
/ci export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.scrutinizer.yml export-ignore | ||
/docker-compose.yml export-ignore | ||
/Dockerfile export-ignore | ||
/phpunit.xml.dist export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*.x" | ||
- "master" | ||
push: | ||
branches: | ||
- "*.x" | ||
- "master" | ||
schedule: | ||
- cron: "42 3 * * 1" | ||
|
||
jobs: | ||
phpunit-mysql: | ||
name: "PHPUnit with MySQL" | ||
runs-on: "ubuntu-20.04" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.3" | ||
- "7.4" | ||
mysql-version: | ||
- "5.7" | ||
- "8.0" | ||
deps: | ||
- "latest" | ||
coverage: | ||
- "false" | ||
extension: | ||
- "mysqli" | ||
- "pdo_mysql" | ||
include: | ||
- php-version: "7.3" | ||
mysql-version: "8.0" | ||
extension: "mysqli" | ||
custom-entrypoint: >- | ||
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | ||
- php-version: "7.3" | ||
mysql-version: "8.0" | ||
extension: "pdo_mysql" | ||
custom-entrypoint: >- | ||
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | ||
- mysql-version: "5.7" | ||
- mysql-version: "8.0" | ||
# https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions | ||
custom-entrypoint: >- | ||
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | ||
- deps: "lowest" | ||
php-version: "7.3" | ||
mysql-version: "5.7" | ||
extension: "pdo_mysql" | ||
coverage: "true" | ||
|
||
services: | ||
mysql: | ||
image: "mysql:${{ matrix.mysql-version }}" | ||
|
||
options: >- | ||
--health-cmd "mysqladmin ping --silent" | ||
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes | ||
-e MYSQL_DATABASE=test | ||
${{ matrix.custom-entrypoint }} | ||
ports: | ||
- "3306:3306" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
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: "Cache dependencies installed with composer" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-locked-" | ||
|
||
- name: "Install dependencies with composer" | ||
run: "composer install --no-interaction --no-progress --no-suggest --prefer-dist" | ||
if: "${{ matrix.deps != 'low' }}" | ||
|
||
- name: "Install lowest possible dependencies with composer" | ||
run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-lowest" | ||
if: "${{ matrix.deps == 'low' }}" | ||
|
||
- name: "Run PHPUnit" | ||
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" | ||
if: "${{ matrix.coverage != 'true' }}" | ||
|
||
- name: "Run PHPUnit with coverage" | ||
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" | ||
if: "${{ matrix.coverage == 'true' }}" | ||
|
||
- name: "Upload coverage" | ||
run: "wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./coverage.xml" | ||
if: "${{ matrix.coverage == 'true' }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.idea | ||
vendor | ||
bin | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
/vendor | ||
/composer.phar | ||
/composer.lock | ||
/phpunit.xml | ||
/.phpunit.result.cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG PHP_VERSION=7.4 | ||
FROM php:${PHP_VERSION}-cli-alpine | ||
|
||
RUN docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) \ | ||
pdo_mysql \ | ||
mysqli | ||
|
||
RUN set -ex \ | ||
&& apk add --no-cache --virtual build-dependencies \ | ||
autoconf \ | ||
make \ | ||
g++ \ | ||
&& pecl install -o xdebug-2.9.8 && docker-php-ext-enable xdebug \ | ||
&& apk del build-dependencies | ||
|
||
ARG COMPOSER_VERSION=2.0.3 | ||
RUN curl -sS https://getcomposer.org/installer | php -- \ | ||
--install-dir=/usr/local/bin --filename=composer --version=$COMPOSER_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd" | ||
colors="true" | ||
bootstrap="../../../vendor/autoload.php" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
<var name="db_driver" value="mysqli" /> | ||
<var name="db_host" value="127.0.0.1" /> | ||
<var name="db_port" value="3306"/> | ||
<var name="db_user" value="root" /> | ||
<var name="db_pass" value="" /> | ||
<var name="db_dbname" value="test" /> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="doctrine-mysql-come-back Test Suite"> | ||
<directory>../../../tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<coverage> | ||
<include> | ||
<directory suffix=".php">../../../src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd" | ||
colors="true" | ||
bootstrap="../../../vendor/autoload.php" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
<var name="db_driver" value="pdo_mysql" /> | ||
<var name="db_host" value="127.0.0.1" /> | ||
<var name="db_port" value="3306"/> | ||
<var name="db_user" value="root" /> | ||
<var name="db_pass" value="" /> | ||
<var name="db_dbname" value="test" /> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="doctrine-mysql-come-back Test Suite"> | ||
<directory>../../../tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<coverage> | ||
<include> | ||
<directory suffix=".php">../../../src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: "3.5" | ||
|
||
x-mysql-props: &mysql-props | ||
environment: | ||
MYSQL_DATABASE: test | ||
MYSQL_USER: root | ||
MYSQL_PASSWORD: "" | ||
MYSQL_ROOT_PASSWORD: "" | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
|
||
x-php-props: &php-props | ||
build: | ||
context: . | ||
args: | ||
PHP_VERSION: 7.3 | ||
volumes: | ||
- ./:/app | ||
working_dir: /app | ||
command: [ "vendor/bin/phpunit" ] | ||
environment: | ||
MYSQL_DATABASE: test | ||
MYSQL_USER: root | ||
MYSQL_PASS: "" | ||
|
||
services: | ||
mysql57: | ||
image: mysql:5.7 | ||
<<: *mysql-props | ||
|
||
mysql80: | ||
image: mysql:8.0 | ||
<<: *mysql-props | ||
|
||
php: | ||
<<: *php-props | ||
build: | ||
context: . | ||
args: | ||
PHP_VERSION: 7.3 | ||
depends_on: | ||
- mysql57 | ||
environment: | ||
MYSQL_HOST: mysql57 | ||
MYSQL_DRIVER: pdo_mysql |
Oops, something went wrong.