Newer
Older
- build
# ===== TEST PyWake debian=====
test_PyWake: # name the job what we like
stage: # build, test, deploy defined by default [2]
test
script:
- pip install -e .[test] --timeout 3600 --default-timeout=3600
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# ===== Check code style =====
check_code_style: # name the job what we like
stage: # build, test, deploy defined by default [2]
test
script:
- pycodestyle --ignore=E501,W504,E741 py_wake
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# ===== TEST PyWake on Windows =====
test_PyWake_windows: # name the job what we like
stage: # build, test, deploy defined by default [2]
test

Mikkel Friis-Møller
committed
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
- conda init powershell
- "if (test-path $PROFILE.CurrentUserAllHosts) { & $PROFILE.CurrentUserAllHosts}"
- pytest --cov-report term-missing:skip-covered --cov=py_wake --cov-config .coveragerc
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# ===== Trigger PyWakePark pipeline =====
trigger_pywake_park_test:
variables:
TRIGGER_BRANCH: $CI_COMMIT_REF_NAME
trigger:
project: TOPFARM/cuttingedge/pywake/pywake_park
strategy: depend
only:
- schedules
variables:
TRIGGER_BRANCH: $CI_COMMIT_REF_NAME
trigger:
project: TOPFARM/cuttingedge/pywake/pywake_ellipsys
strategy: depend
only:
- schedules
# ===== Trigger TriggerHub pipeline =====
trigger_hub_test:
stage: test
variables:
TRIGGER_BRANCH: $CI_COMMIT_REF_NAME
trigger:
project: TOPFARMPrivate/triggerhub/pywaketriggers
strategy: depend
build_pages: # "pages" is a job specifically for GitLab pages [1]
stage: # build, test, deploy defined by default [2]
script: # use sphinx to build docs, move to public page
- pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/TopFarm2.git
- cd docs/validation_report
- python generate_validation_figures.py
- 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
- cd ../../
- pwd
- make html
#- make latexpdf
- cd ../
artifacts: # required for GitLab pages [1]
paths:
- docs/build/html
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
tags: # only runners with this tag can do the job [3]
- ci-ubuntu
# ===== publish documentation =====
pages: # "pages" is a job specifically for GitLab pages [1]
stage: # build, test, deploy defined by default [2]
deploy
dependencies:
- build_pages
script: # use sphinx to build docs, move to public page
- mv docs/build/html public/
artifacts: # required for GitLab pages [1]
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
tags: # only runners with this tag can do the job [3]
stage:
deploy
only:
- tags
- test_pypi
script:
- apt-get update
- pip install -e .[test] --upgrade
- python -c 'from git_utils import get_tag; get_tag(verbose=True)'
- python -m pip install -U setuptools wheel
- python setup.py sdist bdist_wheel
- python -m pip install -U twine
- python -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:
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
build_conda:
stage: build
image: condaforge/mambaforge:latest
dependencies: []
script:
- export VERSION=`git describe --tags --always | sed 's/v//' | sed 's/-/.dev/' | sed 's/-/_/'`
- mamba install -c conda-forge --override-channels -y boa conda-verify
- conda mambabuild --no-anaconda-upload -c conda-forge --override-channels --output-folder ./conda_channel ./recipe
artifacts:
untracked: false
expire_in: "3 days"
paths: ["conda_channel/noarch/py_wake*.tar.bz2"]
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
allow_failure: true
changes:
- setup.py
- recipe/meta.yaml
- when: never
tags:
- ci-ubuntu
deploy_conda:
stage: deploy
image: docker:latest
dependencies: ["build_conda"]
needs: ["build_conda"]
script:
- CONDA_PKG=`basename ./conda_channel/noarch/py_wake*.tar.bz2`
- cp -p ./conda_channel/noarch/$CONDA_PKG /conda_channel_open/noarch/${CONDA_PKG}.tmp
- chown 1000:1000 /conda_channel_open/noarch/${CONDA_PKG}.tmp
- mv /conda_channel_open/noarch/${CONDA_PKG}.tmp /conda_channel_open/noarch/${CONDA_PKG}
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
tags:
- conda_channel
# 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: