language: generic

sudo: required

services:
  - docker

notifications:
  email: false

env:
  - OTP_VERSION=18.3
  - OTP_VERSION=19.0

cache:
  directories:
    - docker-otp-18.3
    - docker-otp-19.0

before_install:
  - docker build -t docker-otp-${OTP_VERSION} -f priv/Dockerfile --build-arg OTP_VERSION=${OTP_VERSION} priv
  - mkdir -p "docker-otp-${OTP_VERSION}"; docker save -o "docker-otp-${OTP_VERSION}/image.tar" docker-otp-${OTP_VERSION}
  # -
  #   if [ -e "docker-otp-${OTP_VERSION}/image.tar" ]; then
  #     docker load -i "docker-otp-${OTP_VERSION}/image.tar";
  #   else
  #     docker build -t docker-otp-${OTP_VERSION} -f priv/Dockerfile --build-arg OTP_VERSION=${OTP_VERSION} priv;
  #     mkdir -p "docker-otp-${OTP_VERSION}"; docker save -o "docker-otp-${OTP_VERSION}/image.tar" docker-otp-${OTP_VERSION};
  #   fi

script:
  - docker run -v `pwd`:/build/libsodium docker-otp-${OTP_VERSION} sh -c 'cd libsodium && CC=clang-3.8 CXX=clang++-3.8 make tests'

language: generic

sudo: required

services:
  - docker

notifications:
  email: false

env:
  - OTP_VERSION=18.3
  - OTP_VERSION=19.0

cache:
  directories:
    - docker-otp-18.3
    - docker-otp-19.0

before_install:
  -
    if [ -e "docker-otp-${OTP_VERSION}/image.tar" ]; then
      docker load -i "docker-otp-${OTP_VERSION}/image.tar";
    else
      docker build -t docker-otp-${OTP_VERSION} -f priv/Dockerfile --build-arg OTP_VERSION=${OTP_VERSION} priv;
      mkdir -p "docker-otp-${OTP_VERSION}"; docker save -o "docker-otp-${OTP_VERSION}/image.tar" docker-otp-${OTP_VERSION};
    fi

script:
  - docker run -v `pwd`:/build/libsodium docker-otp-${OTP_VERSION} sh -c 'cd libsodium && CC=clang-3.8 CXX=clang++-3.8 make tests'

Use cached docker images if available.
Use cached docker images if available.
