-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
102 lines (93 loc) · 2.51 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
default:
image: python:3.9
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PRE_COMMIT_DIR: "${CI_PROJECT_DIR}/.cache/pre-commit"
VENV_DIR: "${CI_PROJECT_DIR}/venv"
cache:
paths:
- ${PIP_CACHE_DIR}
- ${PRE_COMMIT_DIR}
- ${VENV_DIR}${PY_VER}
.install_dependencies:
before_script:
- pip install virtualenv
- pip install -U setuptools
- virtualenv venv_"${PYTHON_VERSION}"
- source venv_"${PYTHON_VERSION}"/bin/activate
- pip install pytest pytest-cov pytest-xdist
- pip install --upgrade "jax[cpu]" jaxlib numba scipy numpy
- pip install -e '.[all]'
- source venv_"${PYTHON_VERSION}"/bin/activate
- python -V
.pages_dependencies:
before_script:
- pip install virtualenv
- virtualenv venv_3.9
- source venv_3.9/bin/activate
- python -V
- pip install mkdocs mkdocs-material mkdocs-autorefs mkdocs-git-revision-date-localized-plugin mkdocs-material \
mkdocs-material-extensions mkdocs-pdf-export-plugin mkdocs-with-pdf mkdocstrings mkdocstrings-python \
mkgendocs mkpdfs-mkdocs black
stages:
- test
- deploy
py39:pytest:
variables:
PYTHON_VERSION: "3.9"
image: python:3.9
stage: test
extends: .install_dependencies
tags:
- public-docker
script:
- pytest -n 2 --log-cli-level=INFO --cov=speadi --ignore=tests/test_install_from_git.py tests/
- coverage xml -o tests/coverage.xml
coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: tests/coverage.xml
various:pytest:
parallel:
matrix:
- PYTHON_VERSION: ['3.7', '3.8', '3.10']
image: python:${PYTHON_VERSION}
stage: test
extends: .install_dependencies
tags:
- public-docker
script:
- pytest -n 2 --log-cli-level=INFO --cov=speadi --ignore=tests/test_install_from_git.py tests/
- coverage xml -o tests/"${PYTHON_VERSION}"_coverage.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: tests/"${PYTHON_VERSION}"_coverage.xml
doc site test:
stage: test
extends: .pages_dependencies
tags:
- public-docker
script:
- mkdocs build --strict --verbose --site-dir site_test
artifacts:
paths:
- site_test
pages:
stage: deploy
extends: .pages_dependencies
needs:
- py39:pytest
- doc site test
tags:
- public-docker
script:
- mkdocs build --strict --verbose --site-dir public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH