-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
84 lines (76 loc) · 2.63 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:3.10.10
# 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"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
before_script:
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -e '.[test]'
test:
stage: test
needs: []
script:
- pytest --cov=recpack recpack/tests/ --cov-config=.coveragerc
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
test-demo-notebooks:
stage: test
needs: []
script:
- pip install jupyter
- ipython examples/Demo.ipynb
- ipython examples/Implement_NeuMF.ipynb
- ipython examples/Implement_your_own_algorithm.ipynb
- ipython examples/Using_Hyperopt.ipynb
pages:
stage: deploy
needs:
- test
script:
- pip install -e '.[doc]'
- cd doc
# Generate the auto generated pages.
# - sphinx-autogen -o source/generated/ source/recpack.algorithms.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.datasets.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.metrics.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.preprocessing.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.scenarios.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.postprocessing.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.pipelines.rst -t source/_templates/
# - sphinx-autogen -o source/generated/ source/recpack.matrix.rst -t source/_templates/
# Render HTML
- make html
# Move the build to public
- mv build/html/ ../public/
artifacts:
paths:
- public
only:
- master
publish:pypi:
stage: deploy
needs:
- test
script:
- sed "s/<<env.CI_JOB_TOKEN>>/${CI_JOB_TOKEN}/" .pypirc > ~/.pypirc
- pip install twine
- python setup.py bdist_wheel
- python3 -m twine upload --repository gitlab dist/*
only:
- tags