sudo: true
dist: trusty
language: rust
cache: cargo
rust:
  - stable
  - beta
  - nightly

addons:
  apt:
    packages:
      - build-essential
      - libnss3-dev

#install:
# Apparently cargo install returns a nonzero exit status if
# caching succeeds, so just make this always "succeed".
#  - (cargo install rustfmt --force || true)

script:
# The NSS version in Ubuntu is too old. Get a newer one.
- |
  wget http://de.archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.32-1ubuntu3_amd64.deb
  wget http://de.archive.ubuntu.com/ubuntu/pool/main/n/nspr/libnspr4_4.16-1ubuntu2_amd64.deb
  sudo dpkg -i libnspr4_4.16-1ubuntu2_amd64.deb
  sudo dpkg -i libnss3_3.32-1ubuntu3_amd64.deb
#- |
#  cargo fmt -- --write-mode=diff
- |
  cargo build --features "$FEATURES" &&
  cargo test &&
  cargo run --example sign_verify
