# ===== DEFINE DOCKER IMAGE =====
# 2018.05.03 dockerhub image generated using docker/Dockerfile_simple
image: rinkdtu/topfarm-ci:latest


# ===== TEST TOPFARM =====
test_topfarm:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:
  - cd tests; py.test --cov-report term-missing:skip-covered --cov=topfarm
  tags:  # select which runners can do this job [3]
  - python


# ===== TEST TOPFARM on Windows =====
test_topfarm_windows:  # name the job what we like
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  stage:  # build, test, deploy defined by default [2]
    test
  script:
  - cd tests
  - c:/Anaconda3/envs/pyTopfarm/python.exe -m pytest --cov-report term-missing:skip-covered --cov=topfarm
  tags:  # select which runners can do this job [3]
  - CPAV_old_PC

# ===== BUILD DOCS AND PUSH TO PUBLIC WEBSITE =====
pages:  # "pages" is a job specifically for GitLab pages [1]
  stage:  # build, test, deploy defined by default [2]
    deploy
  script:  # use sphinx to build docs, move to public page
  - cd docs; make html
  - cd ../; mv docs/build/html public/
  artifacts:  # required for GitLab pages [1]
    paths:
    - public
  only:  # only run for these branches
  - master
  tags:  # select which runners can do this job [3]
  - python


# [1] GitLab page: https://docs.gitlab.com/ee/ci/yaml/#pages
# [2] CI stages: https://docs.gitlab.com/ee/ci/yaml/#stages
# [3] Tags: https://docs.gitlab.com/ee/ci/yaml/#tags