Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.89 KiB
Newer Older
Mads M. Pedersen's avatar
Mads M. Pedersen committed

# ===== TEST PyWake debian=====
test_PyWake:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:
  - pip install -e .
  - py.test
  tags:  # only runners with this tag can do the job [3]
  - python

  
# ===== Check code style =====
check_code_style:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:
  - pip install -e .
  - pycodestyle --ignore=E501,W504,E741 py_wake
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  tags:  # only runners with this tag can do the job [3]
  - python

# ===== TEST PyWake on Windows =====
test_PyWake_windows:  # name the job what we like
  stage:  # build, test, deploy defined by default [2]
    test
  script:  # runs on windows machine due to tag below
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - source activate pyTopfarm
  - pytest --cov-report term-missing:skip-covered --cov=py_wake --cov-config .coveragerc
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  tags:  # tag for shared runner on windows machine
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - ANMH_old

# ===== build documentation =====
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
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - pip install sphinx --upgrade
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - pip install nbsphinx --upgrade
Paul van der Laan's avatar
Paul van der Laan committed
  - pip install -e .
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - cd docs/validation_report
  - python generate_validation_figures.py
Paul van der Laan's avatar
Paul van der Laan committed
  - cd report
  - apt-get install -y texlive-latex-extra
  - pdflatex validation_report.tex
  - bibtex validation_report.aux
  - pdflatex validation_report.tex
  - pdflatex validation_report.tex
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - cd ../../
  - pwd
  - make html
  #- make latexpdf
  - cd ../; mv docs/build/html public/
  artifacts:  # required for GitLab pages [1]
    paths:
    - public
Mads M. Pedersen's avatar
Mads M. Pedersen committed
    #- docs/build/latex/PyWake.pdf
  only:  # only run for these branches
Mads M. Pedersen's avatar
Mads M. Pedersen committed
  - /^test_doc.*/ 
  tags:  # only runners with this tag can do the job [3]
  - python
Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed

pypi_linux:
  stage:  
    deploy
  only:
    - tags
    - test_pypi
  script:
    - apt-get update
Mads M. Pedersen's avatar
Mads M. Pedersen committed
    - pip install pypandoc
Mikkel Friis-Møller's avatar
Mikkel Friis-Møller committed
    - pip install -e . --upgrade
    - python3 -c 'from git_utils import get_tag; get_tag(verbose=True)'
    - python3 -m pip install -U setuptools wheel
    - python3 setup.py sdist bdist_wheel
    - python3 -m pip install -U twine
    - python3 -c 'from git_utils import rename_dist_file; rename_dist_file()'
    - twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
    #- twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD # for testing purposes
  tags:  
    - python

# current
# pypi_windows:
#   stage:  
#     deploy
#   only:
#     - tags
#     - test_pypi
#   script:
#     - c:/Anaconda3/envs/pyTopfarm/python.exe setup.py bdist_wheel
#     - twine upload dist/* -u %TWINE_USERNAME% -p %TWINE_PASSWORD%
#     #- twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u %TWINE_USERNAME% -p %TWINE_PASSWORD% # for testing purposes
#   tags:  
#     - CPAV_old_PC