image: clarinpl/python:3.8

cache:
  paths:
    - .tox

stages:
  - test
  - publish

before_script:
  - apt-get update -yqq
    && apt-get install -yqq --no-install-recommends
    make
    g++
    && apt-get autoremove -yqq --purge
    && apt-get clean

unittests:
  stage: test
  script:
    - pip install tox==2.9.1
    - tox -v -e pytest

pypi_publish:
  before_script:
   - pip install twine
  only:
   - master
  stage: publish
  when: on_success
  script:
    - pip install twine
    - python setup.py sdist bdist_wheel
    - python -m twine upload
     --skip-existing
     --repository-url https://pypi.clarin-pl.eu/
     -u $PIPY_USER
     -p $PIPY_PASS
     dist/combo*.whl