Skip to content

Commit

Permalink
Introduced a smoke testing phase on Travis to run SQLite tests and CS…
Browse files Browse the repository at this point in the history
… checks first
  • Loading branch information
morozov committed Apr 30, 2018
1 parent e51e73e commit 880d17d
Showing 1 changed file with 67 additions and 61 deletions.
128 changes: 67 additions & 61 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ after_script:
php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi
stages:
- smoke testing
- test
- coding standard

jobs:
allow_failures:
- php: nightly
- stage: Coding standard
- stage: coding standard

exclude:
- php: 7.1
Expand All @@ -64,231 +69,244 @@ jobs:
env: DB=mysqli

include:
- stage: Test
- stage: smoke testing
php: 7.1
env: DB=sqlite COVERAGE=yes

- stage: Test
- stage: smoke testing
if: type = pull_request
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- |
if [ $TRAVIS_BRANCH != "master" ]; then
git remote set-branches --add origin $TRAVIS_BRANCH;
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

- php: 7.1
env: DB=mysql COVERAGE=yes

- stage: Test
- stage: test
php: 7.1
env: DB=mysqli COVERAGE=yes

- stage: Test
- stage: test
php: 7.1
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
- stage: test
php: 7.2
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
- stage: test
php: nightly
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh

- stage: Test
- stage: test
php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
- stage: test
php: 7.2
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
- stage: test
php: nightly
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh

- stage: Test
- stage: test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes
addons:
mariadb: 10.0
- stage: Test
- stage: test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.0
addons:
mariadb: 10.0
- stage: Test
- stage: test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.0
addons:
mariadb: 10.0

- stage: Test
- stage: test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.1 COVERAGE=yes
addons:
mariadb: 10.1
- stage: Test
- stage: test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.1
addons:
mariadb: 10.1
- stage: Test
- stage: test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.1
addons:
mariadb: 10.1

- stage: Test
- stage: test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes
addons:
mariadb: 10.2
- stage: Test
- stage: test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.2
addons:
mariadb: 10.2
- stage: Test
- stage: test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.2
addons:
mariadb: 10.2

- stage: Test
- stage: test
php: 7.1
env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes
addons:
mariadb: 10.2
- stage: Test
- stage: test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.2
addons:
mariadb: 10.2
- stage: Test
- stage: test
php: nightly
env: DB=mariadb.mysqli MARIADB_VERSION=10.2
addons:
mariadb: 10.2

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.2"
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.2
services:
- postgresql
addons:
postgresql: "9.2"
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.2
services:
- postgresql
addons:
postgresql: "9.2"

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.3"
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.3
services:
- postgresql
addons:
postgresql: "9.3"
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.3
services:
- postgresql
addons:
postgresql: "9.3"

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.4"
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.4
services:
- postgresql
addons:
postgresql: "9.4"
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.4
services:
- postgresql
addons:
postgresql: "9.4"

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.5"
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.5
services:
- postgresql
addons:
postgresql: "9.5"
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.5
services:
- postgresql
addons:
postgresql: "9.5"

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.6"
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.6
services:
- postgresql
addons:
postgresql: "9.6"
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.6
services:
- postgresql
addons:
postgresql: "9.6"

- stage: Test
- stage: test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes
sudo: required
Expand All @@ -298,7 +316,7 @@ jobs:
postgresql: "9.6"
before_script:
- bash ./tests/travis/install-postgres-10.sh
- stage: Test
- stage: test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=10.0
sudo: required
Expand All @@ -308,7 +326,7 @@ jobs:
postgresql: "9.6"
before_script:
- bash ./tests/travis/install-postgres-10.sh
- stage: Test
- stage: test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=10.0
sudo: required
Expand All @@ -319,15 +337,16 @@ jobs:
before_script:
- bash ./tests/travis/install-postgres-10.sh

- stage: Test
- stage: test
env: DB=sqlsrv COVERAGE=yes
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test

- stage: test
php: 7.2
env: DB=sqlsrv
sudo: required
Expand All @@ -337,7 +356,7 @@ jobs:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
- stage: test
php: 7.1
env: DB=pdo_sqlsrv COVERAGE=yes
sudo: required
Expand All @@ -346,7 +365,8 @@ jobs:
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test

- stage: test
php: 7.2
env: DB=pdo_sqlsrv
sudo: required
Expand All @@ -356,35 +376,21 @@ jobs:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
- stage: test
php: 7.1
env: DB=sqlite DEPENDENCIES=low
install:
- travis_retry composer update --prefer-dist --prefer-lowest

- stage: Test
- 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

- stage: Pull request coding standard
if: type = pull_request
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- |
if [ $TRAVIS_BRANCH != "master" ]; then
git remote set-branches --add origin $TRAVIS_BRANCH;
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

- stage: Coding standard
- stage: coding standard
if: NOT type = pull_request
php: 7.1
install: travis_retry composer install --prefer-dist
Expand Down

0 comments on commit 880d17d

Please sign in to comment.