os: linux
dist: xenial

language: python
cache: pip

env:
  global:
    - PASS_VERSION=1.7.3
  jobs:
    - TEST_MAGIC=file-magic
    - TEST_MAGIC=python-magic

addons:
  apt:
    packages:
      - gnome-keyring

install:
  - export PREFIX=$HOME/.bin/usr PATH="$PATH:$HOME/.bin/usr/bin"
  - wget https://git.zx2c4.com/password-store/snapshot/password-store-$PASS_VERSION.tar.xz
  - tar -xf password-store-$PASS_VERSION.tar.xz
  - make --directory=password-store-$PASS_VERSION install
  - mkdir -p ~/.local/share/keyrings/
  - cp tests/assets/db/gnome-keyring.keyring ~/.local/share/keyrings/pass-import.keyring
  - pip3 install green coverage codacy-coverage pyaml defusedxml cryptography pykeepass secretstorage $TEST_MAGIC

script:
  - dbus-run-session -- make tests

after_success:
  - coverage xml
  - python-codacy-coverage -r coverage.xml

notifications:
  email: false
