2019-05-09 00:20:43 +08:00
|
|
|
#
|
|
|
|
# Travis CI config file
|
|
|
|
#
|
|
|
|
|
2017-06-09 11:27:50 +08:00
|
|
|
language: php
|
|
|
|
php:
|
2019-05-08 23:41:27 +08:00
|
|
|
- '7.2'
|
|
|
|
- '7.3'
|
2019-12-12 01:57:18 +08:00
|
|
|
- '7.4'
|
2019-05-08 23:41:27 +08:00
|
|
|
|
2019-12-12 01:57:18 +08:00
|
|
|
env:
|
|
|
|
- DB=mysql
|
|
|
|
- DB=mariadb
|
2017-12-29 07:32:40 +08:00
|
|
|
|
2018-01-03 04:45:55 +08:00
|
|
|
cache:
|
2019-05-09 00:20:43 +08:00
|
|
|
# Cache lives for 10 min
|
|
|
|
# Default of 3m might not be long enough for all the runs
|
2019-05-09 00:17:38 +08:00
|
|
|
timeout: 600
|
2018-01-03 04:45:55 +08:00
|
|
|
directories:
|
2018-02-03 05:39:53 +08:00
|
|
|
- "$HOME/.composer/cache"
|
|
|
|
- "$HOME/.npm"
|
2018-01-03 04:45:55 +08:00
|
|
|
|
2018-01-10 13:42:07 +08:00
|
|
|
services:
|
2018-02-03 05:39:53 +08:00
|
|
|
- mysql
|
2017-12-29 07:32:40 +08:00
|
|
|
|
2019-12-12 01:57:18 +08:00
|
|
|
addons:
|
|
|
|
mariadb: '10.2'
|
|
|
|
|
2019-06-19 07:48:03 +08:00
|
|
|
install:
|
2019-12-12 01:57:18 +08:00
|
|
|
- php --version
|
|
|
|
- mysql --version
|
2019-06-19 07:48:03 +08:00
|
|
|
- composer install --dev --no-interaction --verbose
|
2018-01-10 13:55:47 +08:00
|
|
|
- cp .travis/env.travis.php env.php
|
2019-06-19 07:30:08 +08:00
|
|
|
- cp .travis/phpunit.travis.xml phpunit.xml
|
2019-05-08 23:36:04 +08:00
|
|
|
|
2019-06-19 07:48:03 +08:00
|
|
|
before_script:
|
2019-06-19 07:32:05 +08:00
|
|
|
- php artisan database:create --reset
|
|
|
|
- php artisan migrate:refresh --seed
|
2018-01-10 13:55:47 +08:00
|
|
|
|
|
|
|
script:
|
2019-05-13 02:26:44 +08:00
|
|
|
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
|
2019-05-08 23:41:27 +08:00
|
|
|
- vendor/bin/phpunit --debug --verbose
|
2018-01-10 13:55:47 +08:00
|
|
|
|
|
|
|
after_failure:
|
2019-05-08 23:41:27 +08:00
|
|
|
- cat storage/logs/*.log
|
2018-01-10 13:55:47 +08:00
|
|
|
|
2019-12-13 04:07:35 +08:00
|
|
|
# Refer to: https://github.com/doctrine/dbal/blob/master/.travis.yml#L39
|
2018-01-10 13:51:40 +08:00
|
|
|
jobs:
|
|
|
|
include:
|
2019-12-13 04:07:35 +08:00
|
|
|
# Different test stages
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.2 + MySQL 5.7
|
|
|
|
# php: 7.2
|
|
|
|
# env: DB=mysql
|
|
|
|
# services:
|
|
|
|
# - mysql
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.3 + MySQL 5.7
|
|
|
|
# php: 7.3
|
|
|
|
# env: DB=mysql
|
|
|
|
# services:
|
|
|
|
# - mysql
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.4 + MySQL 5.7
|
|
|
|
# php: 7.4
|
|
|
|
# env: DB=mysql
|
|
|
|
# services:
|
|
|
|
# - mysql
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.2 + MariaDB 10.1
|
|
|
|
# php: 7.2
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.1'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.3 + MariaDB 10.1
|
|
|
|
# php: 7.3
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.1'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.4 + MariaDB 10.1
|
|
|
|
# php: 7.4
|
|
|
|
# env: DB=mariadb MARIADB_VERSION=10.1
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.1'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.2 + MariaDB 10.2
|
|
|
|
# php: 7.2
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.2'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.3 + MariaDB 10.3
|
|
|
|
# php: 7.3
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.2'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.4 + MariaDB 10.2
|
|
|
|
# php: 7.4
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.2'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.2 + MariaDB 10.3
|
|
|
|
# php: 7.2
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.3'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.3 + MariaDB 10.3
|
|
|
|
# php: 7.3
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.3'
|
|
|
|
# - stage: Test
|
|
|
|
# name: PHP 7.4 + MariaDB 10.3
|
|
|
|
# php: 7.4
|
|
|
|
# env: DB=mariadb
|
|
|
|
# addons:
|
|
|
|
# mariadb: '10.3'
|
|
|
|
|
2019-05-09 00:17:38 +08:00
|
|
|
# Just packages up a release
|
2018-02-04 03:03:11 +08:00
|
|
|
- stage: package
|
2018-01-10 14:02:10 +08:00
|
|
|
script: skip
|
2019-05-09 00:03:52 +08:00
|
|
|
before_deploy:
|
|
|
|
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
|
2019-05-09 00:20:43 +08:00
|
|
|
|
2019-05-08 23:50:46 +08:00
|
|
|
# Configure the conditional deployment
|
|
|
|
# https://docs.travis-ci.com/user/deployment/#examples-of-conditional-deployment
|
2018-01-10 13:51:40 +08:00
|
|
|
deploy:
|
2018-02-04 03:03:11 +08:00
|
|
|
- provider: script
|
|
|
|
skip_cleanup: true
|
2018-02-04 03:50:08 +08:00
|
|
|
script: ./.travis/deploy_script.sh
|
2018-02-04 03:03:11 +08:00
|
|
|
on:
|
2019-05-09 00:18:50 +08:00
|
|
|
all_branches: true
|
2019-05-09 00:20:43 +08:00
|
|
|
repo: nabeelio/phpvms
|
2019-04-08 08:17:44 +08:00
|
|
|
php: '7.2'
|
2019-11-20 00:21:12 +08:00
|
|
|
tags: false
|
2019-05-09 00:17:38 +08:00
|
|
|
|
|
|
|
# RELEASE STAGE
|
|
|
|
# Only runs when there's a tag applied to this release (tag should be the version)
|
|
|
|
# This uses Github Releases and posts it there (provider: releases)
|
|
|
|
# https://docs.travis-ci.com/user/deployment/releases
|
2018-02-04 03:16:37 +08:00
|
|
|
- stage: release
|
2018-02-03 05:09:37 +08:00
|
|
|
script: skip
|
|
|
|
before_deploy:
|
2019-05-09 00:03:52 +08:00
|
|
|
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
|
2018-02-03 05:39:53 +08:00
|
|
|
- ./.travis/deploy_script.sh
|
2018-02-03 05:09:37 +08:00
|
|
|
deploy:
|
2018-02-03 05:39:53 +08:00
|
|
|
provider: releases
|
2018-02-03 05:09:37 +08:00
|
|
|
skip_cleanup: true
|
2019-11-20 00:21:12 +08:00
|
|
|
api_key: $GITHUB_TOKEN
|
2018-02-03 05:39:53 +08:00
|
|
|
file_glob: true
|
2018-02-03 11:41:07 +08:00
|
|
|
file: build/*
|
2018-02-03 05:09:37 +08:00
|
|
|
on:
|
2018-02-04 03:16:37 +08:00
|
|
|
tags: true
|
|
|
|
repo: nabeelio/phpvms
|
2019-04-08 08:17:44 +08:00
|
|
|
php: '7.2'
|