aboutsummaryrefslogtreecommitdiffstats
path: root/posts/libsodium-php-in-travis-ci.md
blob: c540fa96029a11017fe31873ebaaf319d19b69fb (plain)
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
---
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