before_script:
  - export GIT_SSL_NO_VERIFY=1
  - export PATH="$HOME/miniconda2/bin:$PATH"

stages:
  - prepare
  - test
  - report
  - clean

cache:
  paths:
    - test/coverage.xml

prepare:
  stage: prepare
  script:
    - conda update conda
    - conda install -n autosubmit3 coverage=6

test_python3:
  stage: test
  script:
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - conda env update -f environment.yml -n autosubmit3 python=3.7.3
    - source activate autosubmit3
    - python3 -m 'nose' --exclude=regression  --verbosity=3 test/unit

#--with-coverage --cover-package=autosubmit --cover-inclusive --cover-xml --cover-xml-file=test/coverage.xml
# report_codacy:
#   stage: report
#   script:
#     - source activate autosubmit2
#     - pip install codacy-coverage --upgrade
#     - python-codacy-coverage -r test/coverage.xml

clean:
  stage: clean
  script:
    - conda clean --all --yes
