-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
132 lines (122 loc) · 2.88 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
image: mambaorg/micromamba:1.4.3
before_script:
- mkdir -p micromamba
- export MAMBA_ROOT_PREFIX=micromamba
- micromamba create -yf docs/environment.yml
- eval "$(micromamba shell hook --shell bash)"
- micromamba activate meanfi-docs
run tests:
script:
- pip install pytest-cov pytest-randomly pytest-repeat pytest-ruff pytest-regressions
- py.test
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- htmlcov
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
cache:
key: "$CI_JOB_NAME"
paths:
- micromamba
run nox:
variables:
GIT_STRATEGY: clone
CONDA_PKGS_DIRS: micromamba/pkgs
parallel:
matrix:
- NOXSESSION:
- "tests(minimal)"
- "tests(mid)"
- "tests(latest)"
script:
- micromamba install -c conda-forge -y nox mamba
- nox -s $NOXSESSION
cache:
key: "$CI_JOB_NAME"
paths:
- micromamba
run profiler:
script:
- pip install memray pyinstrument
- python profiling/graphene.py
- memray stats memoryProfile.bin
- memray summary memoryProfile.bin
artifacts:
paths:
- timeProfile.html
- memoryProfile.bin
run docs:
variables:
OPENBLAS_NUM_THREADS : 1
OMP_NUM_THREADS : 1
MKL_DYNAMIC : FALSE
MKL_NUM_THREADS : 1
script:
- make -C docs/ html SPHINXOPTS="-WT --keep-going -n"
artifacts:
paths:
- docs/build
cache:
key: "$CI_JOB_NAME"
paths:
- micromamba
pages:
needs:
- run tests
- run profiler
- run docs
script:
- mkdir public
- cp -r htmlcov public/
- cp -r docs/build public/
- cp -r timeProfile.html public/
artifacts:
paths:
- public
run pre-commit:
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
script:
- micromamba install -c conda-forge -y mamba pip pre-commit git
- git config --global --add safe.directory $CI_PROJECT_DIR
- pre-commit run --all-files
cache:
key: "$CI_JOB_NAME"
paths:
- .pre-commit-cache
- micromamba
prepare zips:
image: gitlab.kwant-project.org:5005/qt/research-docker
before_script: []
when: manual
script:
- zip -r zenodo.zip *
artifacts:
paths:
- zenodo.zip
publish to test pypi:
needs:
- run tests
- run docs
- run nox
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*\+test$/' # vX.Y.Z.post1+test
script:
- micromamba install -c conda-forge -y hatch hatch-vcs
- hatch build
- hatch publish -u __token__ -a $PYPI_TEST_TOKEN -r test
publish to pypi:
needs:
- run tests
- run docs
- run nox
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+[^+]*$/' # No +test
script:
- micromamba install -c conda-forge -y hatch hatch-vcs
- hatch build
- hatch publish -u __token__ -a $PYPI_TOKEN