forked from zephir-lang/zephir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
123 lines (104 loc) · 2.8 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
language: php
php:
- 'nightly'
- '7.3'
- '7.2'
- '7.1'
- '7.0'
git:
depth: 1
addons:
apt:
packages:
- gdb
- lcov
matrix:
fast_finish: true
allow_failures:
- php: 'nightly'
cache:
apt: true
timeout: 604800
directories:
- $HOME/.composer/cache
- $HOME/.local/opt
- .phpunit
env:
global:
- RE2C_VERSION="1.1.1"
- ZEPHIR_PARSER_VERSION="v1.3.0"
- COLLECT_COVERAGE=true
- BOX_VERSION=3.3.1
- PATH="${HOME}/bin:${PATH}"
- SYMFONY_PHPUNIT_VERSION=5.7.27
before_install:
- |
# General settings
set -e
stty cols 120
ulimit -c unlimited -S
# Export build/test environment variables
export SYMFONY_PHPUNIT_DIR=$(pwd)/.phpunit
export PHP_VERNUM="$(php-config --vernum)"
if [ ! -z "${GITHUB_TOKEN}" ]; then
composer config github-oauth.github.com ${GITHUB_TOKEN}
printf "Add Github token\n"
fi
[ -d ~/bin ] || mkdir ~/bin
# turn the detached message off
git config --global advice.detachedHead false
install:
- .ci/install-prereqs.sh
- .ci/install-re2c.sh $RE2C_VERSION
- flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
- if [ "$TRAVIS_PHP_VERSION" = "7.2" ]; then composer config platform.php 5.6.33; echo "Preparing to deploy"; fi
- travis_retry composer install $flags
- if [ "$(php-config --vernum)" -ge "70100" ]; then .ci/build-phar.sh; fi
- if [ "$(php-config --vernum)" -lt "70100" ]; then ln -s $(pwd)/zephir ${HOME}/bin/zephir; echo "Use source"; fi
before_script:
- .ci/build-test-ext.sh
- cat .ci/travis.ini >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
script:
- zephir --ansi
- .ci/run-tests.sh
- (cd unit-tests/sharness && make)
after_success:
- .ci/after-success.sh
jobs:
include:
- stage: Static Code Analysis
php: 7.2
env:
- CHECK=php-cs-fixer
- COLLECT_COVERAGE=false
install:
- wget --no-clobber -O $HOME/bin/php-cs-fixer https://cs.sensiolabs.org/download/php-cs-fixer-v2.phar
before_script:
- chmod +x $HOME/bin/php-cs-fixer
script:
- php-cs-fixer --diff --dry-run -v fix
- stage: Static Code Analysis
php: 7.2
env:
- CHECK=PHP_CodeSniffer
- COLLECT_COVERAGE=false
install:
- wget --no-clobber -O $HOME/bin/phpcs https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
before_script:
- chmod +x $HOME/bin/phpcs
script:
- phpcs
notifications:
email: false
before_deploy:
- git config --global user.name cicdbot
- git config --global user.email team@zephir-lang.com
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: zephir.phar
skip_cleanup: true
on:
tags: true
php: '7.2'
repo: phalcon/zephir