-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 1.45 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
stages:
- nox
- deploy
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PATIENT_ABM_DIR: "$CI_PROJECT_DIR"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
# Hence we keep the .nox dir which contains the venv to run the tests
cache:
paths:
- .cache/pip
- .nox/
nox:
image: python:latest
stage: nox
before_script:
- python -V
- pip install -U nox
script:
- nox -r # make sure to use cached venv
coverage: "/TOTAL.+ ([0-9]{1,3}%)/"
# This jobs pushes the package to artifactory, the internal package index
# i.e. allows installation via `pip install patient_abm`
# By default, it is only run on *tagged* commits
build-and-push:
only:
- tags
# - master # uncomment if all commits in master should be pushed
image: python:3.8
stage: deploy
script:
- pip install twine
- python setup.py bdist_wheel
- twine upload dist/* --verbose
# This jobs creates and hosts the package documention
# By default, it is only run on *tagged* commits
pages:
image: python:3.8
stage: deploy
script:
- pip install -U sphinx faculty-sphinx-theme
- pip install .
- make -C docs html
- mv build/sphinx/html/ public/
artifacts:
paths:
- public
only:
- tags
# - master # uncomment if all commits in master should create docs