.travis.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. language: php
  2. matrix:
  3. fast_finish: true
  4. include:
  5. - php: 5.2
  6. - php: 5.3
  7. - php: 5.4
  8. - php: 5.5
  9. - php: 5.6
  10. env: TEST_COVERAGE=1
  11. - php: 7.0
  12. - php: hhvm
  13. # Use new container infrastructure
  14. sudo: false
  15. cache:
  16. directories:
  17. - $HOME/.cache/pip
  18. - $HOME/.composer/cache
  19. - vendor
  20. install:
  21. # Setup the test server
  22. - phpenv local 5.5
  23. - composer install --dev --no-interaction
  24. - TESTPHPBIN=$(phpenv which php)
  25. - phpenv local --unset
  26. # Setup the proxy
  27. - pip install --user mitmproxy~=0.15
  28. before_script:
  29. - PHPBIN=$TESTPHPBIN PORT=8080 vendor/bin/start.sh
  30. - export REQUESTS_TEST_HOST_HTTP="localhost:8080"
  31. # Work out of the tests directory
  32. - cd tests
  33. - PROXYBIN="$HOME/.local/bin/mitmdump" PORT=9002 utils/proxy/start.sh
  34. - PROXYBIN="$HOME/.local/bin/mitmdump" PORT=9003 AUTH="test:pass" utils/proxy/start.sh
  35. - export REQUESTS_HTTP_PROXY="localhost:9002"
  36. - export REQUESTS_HTTP_PROXY_AUTH="localhost:9003"
  37. - export REQUESTS_HTTP_PROXY_AUTH_USER="test"
  38. - export REQUESTS_HTTP_PROXY_AUTH_PASS="pass"
  39. # Ensure the HTTPS test instance on Heroku is spun up
  40. - curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null
  41. script:
  42. - phpunit --coverage-clover clover.xml
  43. after_script:
  44. - utils/proxy/stop.sh
  45. - cd ..
  46. - phpenv local 5.5
  47. - PATH=$PATH vendor/bin/stop.sh
  48. - test $TEST_COVERAGE && bash <(curl -s https://codecov.io/bash)
  49. - phpenv local --unset