diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 1b38ac3651c..577412782ae 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -69,9 +69,58 @@ jobs: - name: "Run a static analysis with vimeo/psalm" run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4" + phpunit-sqlite: + name: "PHPUnit with SQLite" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.3" + - "7.4" + deps: + - fixed + include: + - deps: low + php-version: "7.3" + + 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" + + - 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" + if: ${{ matrix.deps == 'fixed' }} + + - 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.sqlite.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" + phpunit-oci8: name: "PHPUnit on OCI8" runs-on: "ubuntu-latest" + needs: phpunit-sqlite strategy: matrix: @@ -116,6 +165,7 @@ jobs: phpunit-pdo-oci: name: "PHPUnit on PDO_OCI" runs-on: "ubuntu-latest" + needs: phpunit-sqlite strategy: matrix: @@ -156,3 +206,334 @@ jobs: - name: "Upload Code Coverage" uses: "codecov/codecov-action@v1" + + phpunit-postgres: + name: "PHPUnit with PostgreSQL" + runs-on: "ubuntu-latest" + needs: phpunit-sqlite + + strategy: + matrix: + php-version: + - "7.4" + postgres-version: + - "9.3" + - "9.4" + - "9.5" + - "9.6" + - "10" + - "11.1" + + services: + postgres: + image: postgres:${{ matrix.postgres-version }} + env: + POSTGRES_PASSWORD: postgres + + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + ports: + - "5432:5432" + + 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" + + - 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" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.pgsql.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" + + phpunit-mariadb: + name: "PHPUnit with MariaDB" + runs-on: "ubuntu-latest" + needs: phpunit-sqlite + + strategy: + matrix: + php-version: + - "7.4" + mariadb-version: + - "10.0" + - "10.1" + - "10.2" + - "10.3" + driver: + - "mysqli" + - "pdo_mysql" + + services: + mariadb: + image: mariadb:${{ matrix.mariadb-version }} + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: doctrine_tests + + options: >- + --health-cmd "mysqladmin ping --silent" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + ports: + - "33306: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" + + - 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" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.mysql-mariadb.${{ matrix.driver }}.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" + + phpunit-mysql: + name: "PHPUnit with MySQL" + runs-on: "ubuntu-latest" + needs: phpunit-sqlite + + strategy: + matrix: + php-version: + - "7.3" + - "7.4" + mysql-version: + - "5.7" + - "8.0" + driver: + - "mysqli" + - "pdo_mysql" + config-file: + - "mysql-mariadb" + include: + - mysql-version: '5.7' + custom-entrypoint: '' + - 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" + - config-file: "mysql-tls" + php-version: "7.4" + mysql-version: "8.0" + driver: "mysqli" + + services: + mysql: + image: mysql:${{ matrix.mysql-version }} + + options: >- + --health-cmd "mysqladmin ping --silent" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + -e MYSQL_ALLOW_EMPTY_PASSWORD=yes + -e MYSQL_DATABASE=doctrine_tests + ${{ matrix.custom-entrypoint }} + + ports: + - "33306: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" + + - 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" + + - name: "Copy TLS-related files" + run: 'docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/ca.pem" . && docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/client-cert.pem" . && docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/client-key.pem" .' + if: ${{ endsWith(matrix.config-file, 'tls') }} + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.${{ matrix.config-file }}.${{ matrix.driver }}.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" + + phpunit-mssql: + name: "PHPUnit with MSSQL" + runs-on: "ubuntu-latest" + needs: phpunit-sqlite + + strategy: + matrix: + php-version: + - "7.3" + - "7.4" + driver: + - "sqlsrv" + - "pdo_sqlsrv" + collation: + - Latin1_General_100_CI_AS + include: + - collation: Latin1_General_100_CS_AS + php-version: "7.4" + driver: "sqlsrv" + - collation: Latin1_General_100_CS_AS + php-version: "7.4" + driver: "pdo_sqlsrv" + + services: + mssql: + image: microsoft/mssql-server-linux:2017-latest + env: + ACCEPT_EULA: 'Y' + SA_PASSWORD: 'Doctrine2018' + MSSQL_COLLATION: ${{ matrix.collation }} + + options: >- + --health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Doctrine2018" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + ports: + - "1433:1433" + + 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" + tools: pecl + extensions: "${{ matrix.driver }}-5.7.0preview" + + - 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" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.${{ matrix.driver }}.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" + + phpunit-ibm-db2: + name: "PHPUnit with IBM DB2" + runs-on: "ubuntu-latest" + needs: phpunit-sqlite + + strategy: + matrix: + php-version: + - "7.3" + + services: + ibm_db2: + image: ibmcom/db2:11.5.0.0 + env: + DB2INST1_PASSWORD: Doctrine2018 + LICENSE: accept + DBNAME: doctrine + + options: --privileged=true + + ports: + - "50000:50000" + + steps: + - name: "Perform healthcheck from the outside" + run: "docker logs -f ${{ job.services.ibm_db2.id }} | sed '/(*) Setup has completed./ q'" + + - name: "Create temporary tablespace" + run: "docker exec ${{ job.services.ibm_db2.id }} su - db2inst1 -c 'db2 CONNECT TO doctrine && db2 CREATE USER TEMPORARY TABLESPACE doctrine_tbsp PAGESIZE 4 K'" + + - 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: extension=ibm_db2.so, ibm_db2.instance_name=db2inst1 + + - name: "Install ibm_db2 extension" + run: "bash ./ci/github/install-db2-ibm_db2.sh ${{ matrix.php-version }}" + + - 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" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.ibm_db2.xml --coverage-clover=coverage.xml" + + - name: "Upload Code Coverage" + uses: "codecov/codecov-action@v1" diff --git a/.github/workflows/dev-dependencies.yml b/.github/workflows/dev-dependencies.yml new file mode 100644 index 00000000000..dc4201480ec --- /dev/null +++ b/.github/workflows/dev-dependencies.yml @@ -0,0 +1,41 @@ + +name: "Scheduled checks" + +on: + schedule: + - cron: 42 3 * * * + +jobs: + development-deps: + name: "PHPUnit with SQLite and development dependencies" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + + - 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: "Lower minimum stability" + run: "composer config minimum-stability dev" + + - name: "Install development dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit.sqlite.xml" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4621a9afa96..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,191 +0,0 @@ -language: php -dist: xenial - -cache: - directories: - - vendor - - $HOME/.composer/cache - -before_install: - - phpenv config-rm xdebug.ini || true - - pecl install pcov - -before_script: - - | - if [[ -n "$IMAGE" ]] - then - bash ./tests/travis/docker-run-mysql-or-mariadb.sh - fi - -install: - - travis_retry composer -n install --prefer-dist - -script: - - ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -jobs: - include: - - - stage: Smoke Testing - php: 7.3 - env: DB=sqlite - - - stage: Test - php: 7.3 - env: DB=mysql.docker IMAGE=mysql:5.7 - - stage: Test - php: 7.3 - env: DB=mysql.docker IMAGE=mysql:8.0 - - stage: Test - php: 7.3 - env: DB=mysqli.docker IMAGE=mysql:5.7 - - stage: Test - php: 7.3 - env: DB=mysqli.docker IMAGE=mysql:8.0 - - stage: Test - php: 7.3 - env: DB=mariadb.docker IMAGE=mariadb:10.0 - - stage: Test - php: 7.3 - env: DB=mariadb.docker IMAGE=mariadb:10.1 - - stage: Test - php: 7.3 - env: DB=mariadb.docker IMAGE=mariadb:10.2 - - stage: Test - php: 7.3 - env: DB=mariadb.docker IMAGE=mariadb:10.3 - - stage: Test - php: 7.3 - env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.0 - - stage: Test - php: 7.3 - env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.1 - - stage: Test - php: 7.3 - env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.2 - - stage: Test - php: 7.3 - env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 - - stage: Test - dist: trusty - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.2 - services: - - postgresql - addons: - postgresql: "9.2" - - stage: Test - dist: trusty - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.3 - services: - - postgresql - addons: - postgresql: "9.3" - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.4 - addons: - postgresql: "9.4" - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.5 - addons: - postgresql: "9.5" - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=9.6 - addons: - postgresql: "9.6" - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=10.0 - sudo: required - addons: - postgresql: "10" - before_script: - - bash ./tests/travis/install-postgres-10.sh - - stage: Test - php: 7.3 - env: DB=pgsql POSTGRESQL_VERSION=11.0 - sudo: required - before_script: - - bash ./tests/travis/install-postgres-11.sh - - stage: Test - php: 7.3 - env: DB=sqlsrv - sudo: required - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-sqlsrv.sh - - bash ./tests/travis/install-mssql.sh - - stage: Test - php: 7.3 - env: DB=pdo_sqlsrv - sudo: required - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - - bash ./tests/travis/install-mssql.sh - - stage: Test - php: 7.3 - env: DB=ibm_db2 - sudo: required - before_script: - - bash ./tests/travis/install-db2.sh - - bash ./tests/travis/install-db2-ibm_db2.sh - - stage: Test - php: 7.3 - env: DB=sqlite DEPENDENCIES=low - install: - - travis_retry composer update --prefer-dist --prefer-lowest - - stage: Test - php: 7.4 - env: DB=mysql.docker IMAGE=mysql:8.0 - - stage: Test - php: 7.4 - env: DB=mysqli-tls.docker IMAGE=mysql:8.0 TLS=yes - - stage: Test - php: 7.4 - env: DB=mariadb.docker IMAGE=mariadb:10.3 - - stage: Test - php: 7.4 - env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 - - stage: Test - php: 7.4 - env: DB=pgsql POSTGRESQL_VERSION=11.0 - sudo: required - before_script: - - bash ./tests/travis/install-postgres-11.sh - - stage: Test - php: 7.4 - env: DB=sqlite - - stage: Test - php: 7.4 - env: DB=sqlsrv MSSQL_COLLATION=Latin1_General_100_CS_AS - sudo: required - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-sqlsrv.sh - - bash ./tests/travis/install-mssql.sh - - stage: Test - php: 7.4 - env: DB=pdo_sqlsrv MSSQL_COLLATION=Latin1_General_100_CS_AS - sudo: required - before_script: - - bash ./tests/travis/install-sqlsrv-dependencies.sh - - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - - bash ./tests/travis/install-mssql.sh - - stage: Test - if: type = cron - php: 7.2 - env: DB=sqlite DEPENDENCIES=dev - install: - - composer config minimum-stability dev - - travis_retry composer update --prefer-dist - - allow_failures: - - env: DEPENDENCIES=dev diff --git a/tests/travis/install-db2-ibm_db2.sh b/ci/github/install-db2-ibm_db2.sh similarity index 67% rename from tests/travis/install-db2-ibm_db2.sh rename to ci/github/install-db2-ibm_db2.sh index b59bb6396fd..3b89fc76474 100644 --- a/tests/travis/install-db2-ibm_db2.sh +++ b/ci/github/install-db2-ibm_db2.sh @@ -5,8 +5,8 @@ set -ex echo "Installing extension" ( # updating APT packages as per support recommendation - sudo apt -y -q update - sudo apt install ksh + sudo apt-get -y -q update + sudo apt-get install ksh php-pear cd /tmp @@ -21,7 +21,6 @@ echo "Installing extension" cd ibm_db2-* phpize ./configure --with-IBM_DB2=/tmp/dsdriver - make -j `nproc` - make install - echo -e 'extension=ibm_db2.so\nibm_db2.instance_name=db2inst1' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/ibm_db2.ini + make -j $(nproc) + sudo make install ) diff --git a/tests/travis/ibm_db2.travis.xml b/ci/github/phpunit.ibm_db2.xml similarity index 94% rename from tests/travis/ibm_db2.travis.xml rename to ci/github/phpunit.ibm_db2.xml index 3089c56c47a..fcba0b639f7 100644 --- a/tests/travis/ibm_db2.travis.xml +++ b/ci/github/phpunit.ibm_db2.xml @@ -19,7 +19,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/mariadb.mysqli.docker.travis.xml b/ci/github/phpunit.mysql-mariadb.mysqli.xml similarity index 94% rename from tests/travis/mariadb.mysqli.docker.travis.xml rename to ci/github/phpunit.mysql-mariadb.mysqli.xml index d93ca5ceda5..0a8808344cf 100644 --- a/tests/travis/mariadb.mysqli.docker.travis.xml +++ b/ci/github/phpunit.mysql-mariadb.mysqli.xml @@ -19,7 +19,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/mariadb.docker.travis.xml b/ci/github/phpunit.mysql-mariadb.pdo_mysql.xml similarity index 94% rename from tests/travis/mariadb.docker.travis.xml rename to ci/github/phpunit.mysql-mariadb.pdo_mysql.xml index 67f63b2fde4..e54da2e3f32 100644 --- a/tests/travis/mariadb.docker.travis.xml +++ b/ci/github/phpunit.mysql-mariadb.pdo_mysql.xml @@ -19,7 +19,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/mysqli-tls.docker.travis.xml b/ci/github/phpunit.mysql-tls.mysqli.xml similarity index 95% rename from tests/travis/mysqli-tls.docker.travis.xml rename to ci/github/phpunit.mysql-tls.mysqli.xml index f6f653c42bf..febb7bf9a24 100644 --- a/tests/travis/mysqli-tls.docker.travis.xml +++ b/ci/github/phpunit.mysql-tls.mysqli.xml @@ -25,7 +25,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/pdo_sqlsrv.travis.xml b/ci/github/phpunit.pdo_sqlsrv.xml similarity index 94% rename from tests/travis/pdo_sqlsrv.travis.xml rename to ci/github/phpunit.pdo_sqlsrv.xml index 38802c599e9..3743e410a6b 100644 --- a/tests/travis/pdo_sqlsrv.travis.xml +++ b/ci/github/phpunit.pdo_sqlsrv.xml @@ -19,7 +19,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/pgsql.travis.xml b/ci/github/phpunit.pgsql.xml similarity index 90% rename from tests/travis/pgsql.travis.xml rename to ci/github/phpunit.pgsql.xml index 0a1a5c1bebb..3040a427815 100644 --- a/tests/travis/pgsql.travis.xml +++ b/ci/github/phpunit.pgsql.xml @@ -13,12 +13,13 @@ + - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/sqlite.travis.xml b/ci/github/phpunit.sqlite.xml similarity index 92% rename from tests/travis/sqlite.travis.xml rename to ci/github/phpunit.sqlite.xml index ce3c1d0f914..c4726298521 100644 --- a/tests/travis/sqlite.travis.xml +++ b/ci/github/phpunit.sqlite.xml @@ -13,7 +13,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/sqlsrv.travis.xml b/ci/github/phpunit.sqlsrv.xml similarity index 94% rename from tests/travis/sqlsrv.travis.xml rename to ci/github/phpunit.sqlsrv.xml index de56350ce9d..bec0b17883e 100644 --- a/tests/travis/sqlsrv.travis.xml +++ b/ci/github/phpunit.sqlsrv.xml @@ -19,7 +19,7 @@ - ../Doctrine/Tests/DBAL + ../../tests diff --git a/tests/travis/docker-run-mysql-or-mariadb.sh b/tests/travis/docker-run-mysql-or-mariadb.sh deleted file mode 100644 index de0e53b9fcf..00000000000 --- a/tests/travis/docker-run-mysql-or-mariadb.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Starting RDBMS…">&2 - -if [[ "$IMAGE" == "mysql:8.0" ]] -then - CMD_OPTIONS="--default-authentication-plugin=mysql_native_password" -else - CMD_OPTIONS="" -fi - -docker run \ - --health-cmd='mysqladmin ping --silent' \ - --detach \ - --env MYSQL_ALLOW_EMPTY_PASSWORD=yes \ - --env MYSQL_DATABASE=doctrine_tests \ - --publish 33306:3306 \ - --name rdbms \ - "$IMAGE" $CMD_OPTIONS - -while true; do - healthStatus=$(docker inspect --format "{{json .State.Health.Status }}" rdbms) - case $healthStatus in - '"starting"') - echo "Waiting for RDBMS to become ready…">&2 - sleep 1 - ;; - '"healthy"') - echo "Container is healthy">&2 - break - ;; - '"unhealthy"') - echo "Container is unhealthy">&2 - exit 1 - ;; - *) - echo "Unexpected health status $healthStatus">&2 - ;; - esac -done - -if [[ "$TLS" == "yes" ]] -then - for file in "ca.pem" "client-cert.pem" "client-key.pem" - do - docker cp "rdbms:/var/lib/mysql/$file" . - done -fi diff --git a/tests/travis/install-db2.sh b/tests/travis/install-db2.sh deleted file mode 100644 index 79c1be98f74..00000000000 --- a/tests/travis/install-db2.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo Setting up IBM DB2 - -echo "su - db2inst1 -c 'db2 CONNECT TO doctrine && db2 CREATE USER TEMPORARY TABLESPACE doctrine_tbsp PAGESIZE 4 K'" > /tmp/doctrine-init.sh -chmod +x /tmp/doctrine-init.sh - -sudo docker run \ - -d \ - -p 50000:50000 \ - -e DB2INST1_PASSWORD=Doctrine2018 \ - -e LICENSE=accept \ - -e DBNAME=doctrine \ - -v /tmp/doctrine-init.sh:/var/custom/doctrine-init.sh:ro \ - --name db2 \ - --privileged=true \ - ibmcom/db2:11.5.0.0 - -sudo docker logs -f db2 | sed '/(*) Setup has completed./ q' - -echo DB2 started diff --git a/tests/travis/install-mssql-pdo_sqlsrv.sh b/tests/travis/install-mssql-pdo_sqlsrv.sh deleted file mode 100644 index 71e07aee231..00000000000 --- a/tests/travis/install-mssql-pdo_sqlsrv.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Installing extension" - -pecl install pdo_sqlsrv-5.7.0preview diff --git a/tests/travis/install-mssql-sqlsrv.sh b/tests/travis/install-mssql-sqlsrv.sh deleted file mode 100644 index d44841360dc..00000000000 --- a/tests/travis/install-mssql-sqlsrv.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Installing extension" - -pecl install sqlsrv-5.7.0preview diff --git a/tests/travis/install-mssql.sh b/tests/travis/install-mssql.sh deleted file mode 100644 index d17058e3455..00000000000 --- a/tests/travis/install-mssql.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo Setting up Microsoft SQL Server - -sudo docker pull microsoft/mssql-server-linux:2017-latest -sudo docker run \ - -e 'ACCEPT_EULA=Y' \ - -e 'SA_PASSWORD=Doctrine2018' \ - -e "MSSQL_COLLATION=${MSSQL_COLLATION:-Latin1_General_100_CI_AS}" \ - -p 127.0.0.1:1433:1433 \ - --name mssql \ - -d \ - microsoft/mssql-server-linux:2017-latest - -sudo docker exec -i mssql bash <<< 'until echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Doctrine2018 > /dev/null 2>&1 ; do sleep 1; done' - -echo SQL Server started diff --git a/tests/travis/install-postgres-10.sh b/tests/travis/install-postgres-10.sh deleted file mode 100644 index 88041241e6e..00000000000 --- a/tests/travis/install-postgres-10.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Installing Postgres 10" -sudo service postgresql stop -sudo apt-get remove -q 'postgresql-*' -sudo apt-get update -q -sudo apt-get install -q postgresql-10 postgresql-client-10 -sudo cp /etc/postgresql/{9.6,10}/main/pg_hba.conf - -echo "Restarting Postgres 10" -sudo service postgresql restart diff --git a/tests/travis/install-postgres-11.sh b/tests/travis/install-postgres-11.sh deleted file mode 100644 index 2ef1aabc4f0..00000000000 --- a/tests/travis/install-postgres-11.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Preparing Postgres 11" - -sudo service postgresql stop || true - -sudo docker run -d --name postgres11 -p 5432:5432 postgres:11.1 -sudo docker exec -i postgres11 bash <<< 'until pg_isready -U postgres > /dev/null 2>&1 ; do sleep 1; done' - -echo "Postgres 11 ready" diff --git a/tests/travis/install-sqlsrv-dependencies.sh b/tests/travis/install-sqlsrv-dependencies.sh deleted file mode 100644 index ff91bfdfaf0..00000000000 --- a/tests/travis/install-sqlsrv-dependencies.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo Installing driver dependencies - -curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - -curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list -sudo apt-get update -ACCEPT_EULA=Y sudo apt-get install -qy msodbcsql17 unixodbc unixodbc-dev libssl1.0.0 diff --git a/tests/travis/mysql.docker.travis.xml b/tests/travis/mysql.docker.travis.xml deleted file mode 100644 index 67f63b2fde4..00000000000 --- a/tests/travis/mysql.docker.travis.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - diff --git a/tests/travis/mysqli.docker.travis.xml b/tests/travis/mysqli.docker.travis.xml deleted file mode 100644 index d93ca5ceda5..00000000000 --- a/tests/travis/mysqli.docker.travis.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - -