phpvms/.travis.yml
2019-11-19 11:21:12 -05:00

82 lines
2.0 KiB
YAML

#
# Travis CI config file
#
language: php
php:
- '7.2'
- '7.3'
matrix:
include:
- php: '7.2'
- php: '7.3'
fast_finish: true
cache:
# Cache lives for 10 min
# Default of 3m might not be long enough for all the runs
timeout: 600
directories:
- "$HOME/.composer/cache"
- "$HOME/.npm"
services:
- mysql
install:
- composer install --dev --no-interaction --verbose
- cp .travis/env.travis.php env.php
- cp .travis/phpunit.travis.xml phpunit.xml
before_script:
- php artisan database:create --reset
- php artisan migrate:refresh --seed
script:
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
- vendor/bin/phpunit --debug --verbose
after_failure:
- cat storage/logs/*.log
jobs:
include:
# Just packages up a release
- stage: package
script: skip
before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
# Configure the conditional deployment
# https://docs.travis-ci.com/user/deployment/#examples-of-conditional-deployment
deploy:
- provider: script
skip_cleanup: true
script: ./.travis/deploy_script.sh
on:
all_branches: true
repo: nabeelio/phpvms
php: '7.2'
tags: false
# 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
- stage: release
script: skip
before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
- ./.travis/deploy_script.sh
deploy:
provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file_glob: true
file: build/*
on:
tags: true
repo: nabeelio/phpvms
php: '7.2'