Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.39 KiB
Newer Older
Jenni Rinker's avatar
Jenni Rinker committed
# ===== DEFINE DEFAULT DOCKER IMAGE =====
# dockerhub image generated using docker/Dockerfile_simple
image: dtuwindenergy/topfarm2:latest
# ===== TEST TOPFARM =====
test_topfarm:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:
Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed
  - py.test
Jenni Rinker's avatar
Jenni Rinker committed
  tags:  # only runners with this tag can do the job [3]
  - python

  
# ===== TEST TOPFARM =====
test_topfarm_pep8:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:
Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed
  - pycodestyle --ignore=E501,W504 --exclude="*Colonel*" topfarm
  tags:  # only runners with this tag can do the job [3]
  - python
Mads M. Pedersen's avatar
Mads M. Pedersen committed
# ===== TEST TOPFARM on Windows =====
Mads M. Pedersen's avatar
Mads M. Pedersen committed
test_topfarm_windows:  # name the job what we like
  variables:
    GIT_SUBMODULE_STRATEGY: normal
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  stage:  # build, test, deploy defined by default [2]
    test
Jenni Rinker's avatar
Jenni Rinker committed
  script:  # runs on windows machine due to tag below
Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed
  - c:/Anaconda3/envs/pyTopfarm_openmdao_2_6/scripts/pip install -e .
  - c:/Anaconda3/envs/pyTopfarm_openmdao_2_6/python.exe -m pytest --cov-report term-missing:skip-covered --cov=topfarm --cov-config .coveragerc --ignore=topfarm/cost_models/fuga/Colonel
Jenni Rinker's avatar
Jenni Rinker committed
  tags:  # tag for shared runner on windows machine
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - CPAV_old_PC

Jennifer Rinker's avatar
Jennifer Rinker committed
# ===== 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
Jenni Rinker's avatar
Jenni Rinker committed
  - pip install -e .
  - cd docs; make html
  - cd ../; mv docs/build/html public/
Jennifer Rinker's avatar
Jennifer Rinker committed
  artifacts:  # required for GitLab pages [1]
    paths:
    - public
  only:  # only run for these branches
  - master
Jenni Rinker's avatar
Jenni Rinker committed
  tags:  # only runners with this tag can do the job [3]
Jennifer Rinker's avatar
Jennifer Rinker committed
  - python

Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed
# ===== BUILD WHEELS AND UPLOAD TO PYPI =====
pypi:
  stage:  
    deploy
  only:
    - tags
#    - master
  script:
    - python3 -m pip install -U setuptools wheel
    - python3 setup.py sdist bdist_wheel
    - python3 -m pip install -U twine
    # - twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD # for testing purposes
    - twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
  tags:  
    - python

Jennifer Rinker's avatar
Jennifer Rinker committed

# [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