language: go
dist: trusty
sudo: required
go: 
    - 1.7
    - 1.8
    - 1.9.x
    - tip

matrix:
  # If the latest unstable development version of go fails, that's OK.
  allow_failures:
    - go: tip

  # Don't hold on the tip tests to finish.  Mark tests green if the
  # stable versions pass.
  fast_finish: true

services:
    - docker
before_install:
    - sudo add-apt-repository -y ppa:duggan/bats
    - sudo apt-get -qq update
    - sudo apt-get -qq install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libselinux1-dev
    - sudo apt-get -qq remove libseccomp2
script:
    - make install.tools install.libseccomp.sudo all runc validate TAGS="apparmor seccomp containers_image_ostree_stub"
    - go test -c -tags "apparmor seccomp `./btrfs_tag.sh` `./libdm_tag.sh` `./ostree_tag.sh` `./selinux_tag.sh`" ./cmd/buildah
    - tmp=`mktemp -d`; mkdir $tmp/root $tmp/runroot; sudo PATH="$PATH" ./buildah.test -test.v -root $tmp/root -runroot $tmp/runroot -storage-driver vfs -signature-policy `pwd`/tests/policy.json
    - cd tests; sudo PATH="$PATH" ./test_runner.sh
