Skip to content

Commit

Permalink
Travis Matrix Test + jobs for other platforms (#20)
Browse files Browse the repository at this point in the history
Testing via Matrix Jobs (for merging coverage from different jobs)

added jobs for testing PHP 7.2, 7.3, 7.4
added jobs for testing PostgreSQL 9.2, 9.3, 9.4, 9.5, 9.6, 10.0, 11.0
New features in Blueprint:

added auto-convert values with USING after ALTER COLUMN CHANGE TYPE
added support method: ->using() for converting values between different types
added support Expression for default values: ->default(new Expression(''))

Resolved issues: #8, #10
  • Loading branch information
pvsaintpe authored and lazeevv committed Aug 5, 2019
1 parent 0e7964e commit 9b419f2
Show file tree
Hide file tree
Showing 33 changed files with 2,457 additions and 655 deletions.
120 changes: 107 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,117 @@
language: php
sudo: false
dist: trusty

php:
- 7.2
cache:
directories:
- vendor
- $HOME/.composer/cache

services:
- postgresql

matrix:
fast_finish: true
before_install:
- phpenv config-rm xdebug.ini || true
- |
if [ "x$COVERAGE" == "xyes" ]; then
pecl install pcov-1.0.0
fi
install:
- composer install

before_script:
- psql -c 'create database testing;' -U postgres
- rm composer.lock
- travis_retry composer -n update --prefer-dist

script:
- vendor/bin/ecs check --config=ecs.yml .
- phpdbg -qrr vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- |
if [ "x$DOCKER_POSTGRES" == "xyes" ]; then
sudo docker exec -ti postgres11 psql postgres -U postgres -c "CREATE DATABASE testing"
else
psql -c 'CREATE DATABASE testing;' -U postgres
fi
- |
if [ "x$COVERAGE" == "xyes" ]; then
./vendor/bin/phpunit --configuration phpunit.travis.xml --coverage-clover build/logs/clover.xml
else
./vendor/bin/phpunit --configuration phpunit.travis.xml
fi
after_success:
- travis_retry vendor/bin/php-coveralls -v
- |
if [ "x$COVERAGE" == "xyes" ]; then
travis_retry vendor/bin/php-coveralls -v
fi
matrix:
fast_finish: true
allow_failures:
- php: "7.4snapshot"
include:
- stage: Test
php: "7.2"
env: DB=pgsql POSTGRESQL_VERSION=11.0
sudo: required
services:
- docker
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.2"
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.3"
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.4"
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.5"
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.6"
- stage: Test
php: "7.3"
env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes
sudo: required
services:
- postgresql
addons:
postgresql: "9.6"
before_script:
- bash ./tests/travis/install-postgres-10.sh
- stage: Test
php: "7.3"
env: DB=pgsql DOCKER_POSTGRES=yes POSTGRESQL_VERSION=11.0 COVERAGE=yes
sudo: required
services:
- docker
- postgresql
addons:
postgresql: "9.6"
before_script:
- bash ./tests/travis/install-postgres-11.sh
- stage: Test
php: "7.4snapshot"
env: DB=pgsql DOCKER_POSTGRES=yes POSTGRESQL_VERSION=11.0
sudo: required
services:
- docker
- postgresql
before_script:
- bash ./tests/travis/install-postgres-11.sh
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ php composer.phar require umbrellio/laravel-pg-extensions
## Features

- [Extended `Schema::create()`](#extended-table-creation)
- [Extended `Schema` with GIST/GIN indexes](#create-gist/gin-indexes)
- [Added Support Numeric Type](#numeric-column-type)
- [Extended `Schema` with USING](#extended-schema-using)
- [Extended `Schema` for views](#create-views)
- [Working with unique indexes](#extended-unique-indexes-creation)
- [Working with partitions](#partitions)
Expand All @@ -31,12 +32,21 @@ Schema::create('table', function (Blueprint $table) {
});
```

### Create gist/gin indexes
### Extended Schema USING

Example:
```php
Schema::create('table', function (Blueprint $table) {
$table->gist(['column1', 'column2']);
$table->gin('column1');
$table->integer('number');
});

//modifications with data...

Schema::table('table', function (Blueprint $table) {
$table
->string('number')
->using("('[' || number || ']')::character varyiing")
->change();
});
```

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
],
"require": {
"php": "^7.2",
"doctrine/dbal": "^2.9",
"laravel/framework": "^5.8"
},
"require-dev": {
"umbrellio/code-style-php": "^1.0",
"codeception/codeception": "^3.0",
"orchestra/testbench": "^3.5",
"php-coveralls/php-coveralls": "^2.1"
},
Expand Down
Loading

0 comments on commit 9b419f2

Please sign in to comment.