-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
159 lines (130 loc) · 3.38 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
default:
image: "registry.gitlab.com/synsense/rockpool/clean:latest"
stages:
- preliminaries
- test
- docs
- docs_deploy
- build
- deploy
black-check:
stage: preliminaries
needs: []
image: "registry.gitlab.com/synsense/rockpool/clean:latest"
before_script:
- pip install --upgrade pip
- pip install black==23.1.0
script:
- python -m black --check rockpool tests
gpu_validation:
stage: preliminaries
image: "registry.gitlab.com/synsense/rockpool/clean:latest"
allow_failure: true
tags:
- cuda
script:
- nvidia-smi
- which nvcc
unit_tests_clean:
stage: test
image: "registry.gitlab.com/synsense/rockpool/clean:latest"
tags:
- cuda
before_script:
- pip install --upgrade pip
- pip install --upgrade ".[all]" --no-cache-dir
- python -c 'import samna'
- pip install --upgrade sinabs-exodus --no-cache-dir || exit_code=$?
- if [ $exit_code -ne 0 ]; then echo "Exodus could not be installed"; fi;
script:
- pytest -v tests/tests_default --random-order
unit_tests_known_good:
stage: test
needs: []
image: "registry.gitlab.com/synsense/rockpool/known_good:latest"
tags:
- cuda
# parallel: 4
before_script:
- pip install --upgrade pip
- pip install --upgrade ".[all]" --no-cache-dir
- pip install --upgrade sinabs-exodus --no-cache-dir || exit_code=$?
- pip install pytest pytest-cov
- if [ $exit_code -ne 0 ]; then echo "Exodus could not be installed"; fi;
script:
- pytest --cov --cov-report term --cov-report xml:coverage.xml -v tests/tests_default --random-order --junitxml="test_report.xml" #--test-group-count $CI_NODE_TOTAL --test-group=$CI_NODE_INDEX
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- test_report.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: test_report.xml
expire_in: 1 day
documentation_linting:
stage: docs
image: "registry.gitlab.com/synsense/rockpool/known_good:latest"
allow_failure: true
needs: []
before_script:
- pip install --upgrade pip
- pip install --upgrade ".[all]" --no-cache-dir
- python -c 'import samna'
script:
- sphinx-build -n -b dummy docs docs/_build/html
docs_build:
stage: docs
image: "registry.gitlab.com/synsense/rockpool/known_good:latest"
allow_failure: true
before_script:
- pip install --upgrade pip
- pip install ".[all]" --no-cache-dir
- python -c 'import samna'
script:
- cp CHANGELOG.md docs/advanced
- sphinx-build -b html docs docs/_build/html
artifacts:
paths:
- docs/_build/html
expire_in: 15 mins
dist_build:
stage: build
needs: ["unit_tests_known_good", "unit_tests_clean"]
before_script:
- pip install --upgrade pip
- pip install wheel
script:
- python setup.py sdist
artifacts:
paths:
- dist
pages:
stage: docs_deploy
only:
- master
allow_failure: true
dependencies:
- docs_build
script:
- mv docs/_build/html/ public/
artifacts:
paths:
- public
pypi_deploy:
stage: deploy
when: manual
only:
- master
dependencies:
- dist_build
before_script:
- pip install --upgrade pip
- pip install -U twine
variables:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: $PYPI_PASSWORD
script:
- python -m twine upload dist/*