How to install custom PHP extension on Travis (OAuth)

I would like to install the PHP extensionOAuth in my build environment on Travis.

I tried these two configurations in a file .travis.yml: COnfiguration 1 (using before_script):

language: php

matrix:
    include:
        - php: 5.3
        - php: 5.4
        - php: 5.5
        - php: 5.6
        - php: 7.0
        - php: hhvm

cache:
    directories:
        - $HOME/.composer/cache

install:
    - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction

script:
    - phpunit --verbose --coverage-clover build/logs/clover.xml
    - phpenv config-rm xdebug.ini || return 0

before_script:
    - pecl install oauth

Configuration 2 (using install):

language: php

matrix:
    include:
        - php: 5.3
        - php: 5.4
        - php: 5.5
        - php: 5.6
        - php: 7.0
        - php: hhvm

cache:
    directories:
        - $HOME/.composer/cache

install:
    - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction
    - pecl install oauth

script:
    - phpunit --verbose --coverage-clover build/logs/clover.xml
    - phpenv config-rm xdebug.ini || return 0

The documentation is unclear where to place the commands to install custom PHP extensions (or maybe I didn’t understand this). perhaps!).

Anyway, can someone help me configure Travis to install the OAuthPHP extension ? Thankyou!

+4
source share
1 answer

Source: https://habr.com/ru/post/1629186/


All Articles