forked from WordPress/Requests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (55 loc) · 1.53 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
dist: trusty
language: php
matrix:
fast_finish: true
include:
- php: 5.2
dist: precise
- php: 5.3
dist: precise
- php: 5.4
- php: 5.5
- php: 5.6
env: TEST_COVERAGE=1
- php: 7.0
- php: 7.1
- php: 7.2
- php: nightly
allow_failures:
- php: nightly
# Use new container infrastructure
sudo: false
cache:
directories:
- $HOME/.cache/pip
- $HOME/.composer/cache/files
install:
# Setup the test server
- phpenv local $( phpenv versions | grep 5.6 | tail -1 )
- composer install --dev --no-interaction
- TESTPHPBIN=$(phpenv which php)
- phpenv local --unset
# Setup the proxy
- pip install --user mitmproxy==0.18.2
before_script:
- PHPBIN=$TESTPHPBIN PORT=8080 vendor/bin/start.sh
- export REQUESTS_TEST_HOST_HTTP="localhost:8080"
# Work out of the tests directory
- cd tests
- PROXYBIN="$HOME/.local/bin/mitmdump" PORT=9002 utils/proxy/start.sh
- PROXYBIN="$HOME/.local/bin/mitmdump" PORT=9003 AUTH="test:pass" utils/proxy/start.sh
- export REQUESTS_HTTP_PROXY="localhost:9002"
- export REQUESTS_HTTP_PROXY_AUTH="localhost:9003"
- export REQUESTS_HTTP_PROXY_AUTH_USER="test"
- export REQUESTS_HTTP_PROXY_AUTH_PASS="pass"
# Ensure the HTTPS test instance on Heroku is spun up
- curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null
# Environment checks
- phpunit --version
script:
- phpunit --coverage-clover clover.xml
after_script:
- utils/proxy/stop.sh
- cd ..
- PATH=$PATH vendor/bin/stop.sh
- test $TEST_COVERAGE && bash <(curl -s https://codecov.io/bash)