ref: e107b46712f6bd52301961e3a47580b0a8cbb0e6 www.tuxed.net/posts/libsodium-php-in-travis-ci.md -rw-r--r-- 1.0 KiB
e107b467François Kooman add php-jwt 3 years ago

#title: Using libsodium-php in Travis-CI published: 2017-01-25 updated: 2017-01-25

Update: switched to new PPA, from ppa:chris-lea/libsodium to ppa:ondrej/php that contains a newer libsodium that actually has \Sodium\compare.

For my OAuth 2.0 server I needed to be able to use libsodium in PHP, unfortunately the images on Travis-CI are still based on Ubuntu precise, or if you want trusty, but they do not contain libsodium-dev which would be needed to install the PECL module libsodium-php.

So, below you'll find my .travis.yml that installs both libsodium-dev from a PPA and builds the PECL module:

language: php
sudo: required
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - sudo add-apt-repository ppa:ondrej/php -y
  - sudo apt-get update -q
  - sudo apt-get install libsodium-dev -y
  - pecl install libsodium
  - composer install

script: phpunit --coverage-text tests