aboutsummaryrefslogtreecommitdiffstats
path: root/posts/libsodium-php-in-travis-ci.md
diff options
context:
space:
mode:
Diffstat (limited to 'posts/libsodium-php-in-travis-ci.md')
-rw-r--r--posts/libsodium-php-in-travis-ci.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/posts/libsodium-php-in-travis-ci.md b/posts/libsodium-php-in-travis-ci.md
new file mode 100644
index 0000000..c540fa9
--- /dev/null
+++ b/posts/libsodium-php-in-travis-ci.md
@@ -0,0 +1,31 @@
+---
+title: Using libsodium-php in Travis-CI
+published: 2017-01-25
+---
+
+For my OAuth 2.0 server I needed to be able to use
+[libsodium](https://github.com/jedisct1/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
+ php:
+ - 5.4
+ - 5.5
+ - 5.6
+ - 7.0
+ - 7.1
+ before_install:
+ - sudo add-apt-repository ppa:chris-lea/libsodium -y
+ - sudo apt-get update -q
+ - sudo apt-get install libsodium-dev -y
+ before_script:
+ - pecl install libsodium
+ - composer install
+
+ script: phpunit --coverage-text tests