This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 575
/
.travis.yml
84 lines (66 loc) · 2.28 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
dist: trusty
sudo: required
services:
- mysql
before_install:
# This is mandatory or the 'apt-get install' calls following will fail
- sudo apt-get update -qq
- sudo apt-get install -y apache2 libapache2-mod-fastcgi
# Disable xdebug for speed (executing composer), but allow us to re-enable it later
- export XDEBUG_INI=`php -i | grep xdebug.ini | grep home/travis | grep -v '=>' | head -1`
- export XDEBUG_INI=${XDEBUG_INI/,/}
- if [ "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI" "$XDEBUG_INI.bak"; fi
# Get Node.JS ready
- sudo rm -rf ~/.nvm - curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
- sudo apt-get install -y nodejs
install:
- composer install --ignore-platform-reqs
# Re-enable xdebug for when we need to generate code coverage
- export COVERAGE_OPTS=""
- if [ "$TRAVIS_PHP_VERSION" = "5.6" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI" && export COVERAGE_OPTS="--coverage-clover=coverage.clover"; fi
# Set up node.js and puppeteer
- npm install
before_script:
# Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
- ./test/travis-ci/setup-php-fpm.sh
- ./test/travis-ci/setup-apache.sh
script:
- npm test
- ./vendor/bin/peridot -c test/peridot.php
after_failure:
# Save as much info as we can to help developers
- cat apache_error.log
- cat apache_access.log
after_script:
# Upload code-coverage to Scrutinizer
- if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ -f coverage.clover ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
# Upload code-coverage CodeClimate
- if [ -f coverage.clover ]; then CODECLIMATE_REPO_TOKEN=<INSERT TOKEN HERE> ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi
# Start the release build script
after_success: ./test/travis-ci/release.sh
# Deploy to GitHub
before_deploy:
- provider: releases
api_key:
secure: "GITHUB ACCESS TOKEN"
file: "release.tar.gz"
skip_cleanup: true
on:
repo: anchorcms/anchor-cms
branch: master
tags: true
after_deploy:
# - ./deploy-gh-pages.sh
git:
depth: 5
cache:
directories:
- "$HOME/.composer/cache/files"
- node_modules