-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
146 lines (128 loc) · 3.62 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
# pyvista config for x server
# see https://github.com/pyvista/gl-ci-helpers/blob/master/travis/setup_headless_display.sh
variables:
TERM: "xterm"
DISPLAY: ":99.0"
PYVISTA_OFF_SCREEN: "true"
stages:
- badge
- zenodo
- kaggle
- modal
- trigdoc
- trigdocker
- test
- deploy
.before-python: &before-python
## install os tools
- apt-get update -q && apt-get install -q -y --no-install-recommends make libgl1-mesa-dev xvfb
- python -V # Print out python version for debugging
- which Xvfb
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- sleep 3
badge:
stage: badge
image:
name: alpine/git:latest
entrypoint: [""]
script:
- echo "collecting stats for badges"
- commits=`git rev-list --all --count`
- latest_release_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
- logo=$(cat ./doc/_assets/opt.svg | tr '"' "'")
- echo {\"schemaVersion\":"1", \"commits\":\"$commits\", \"release_tag\":\"$latest_release_tag\"} > badges.json
- echo {\"schemaVersion\":"1", \"logoSvg\":\"$logo\", \"label\":\"release\", \"message\":\"$latest_release_tag\", \"color\":\"1672a7\", \"labelColor\":\"dedede\", \"style\":\"for-the-badge\"} > logobadge.json
artifacts:
paths:
- badges.json
- logobadge.json
staging:
stage: trigdoc
trigger: nannos/nannos.gitlab.io
only:
- master
container:
stage: trigdocker
trigger: nannos/docker
only:
- tags
test:
stage: test
image: benvial/nannos:latest
before_script:
- *before-python
script:
- make install
- make test-req
- make test
- coverage xml
coverage: '/TOTAL.*\s([.\d]+)%/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
only:
- master
send-snapshot:
stage: zenodo
image: python
script:
- apk update && apk add git
- if [[ ! $CI_COMMIT_TAG =~ ^v?[0-9]+\.[0-9]+ ]]; then exit 0; fi
- pip install gitlab2zenodo
- git archive --format zip --output ${CI_COMMIT_TAG#v}.zip ${CI_COMMIT_TAG}
- g2z-send -p -t $zenodo_token -m .zenodo.json ${CI_COMMIT_TAG#v}.zip
only:
- tags
push-kernel:
stage: kaggle
image: python
script:
- if [[ ! $CI_COMMIT_TAG =~ ^v?[0-9]+\.[0-9]+ ]]; then exit 0; fi
- pip install kaggle
- cd examples/benchmarks/kaggle && make -s pull && make -s dld && make -s push
only:
- tags
benchmark-modal:
stage: modal
image: benvial/nannos:latest
script:
# - if [[ ! $CI_COMMIT_TAG =~ ^v?[0-9]+\.[0-9]+ ]]; then exit 0; fi
- pip install modal
- cd examples/benchmarks/modal && modal run run_nannos.py
# only:
# - tags
pypi:
image: python:latest
stage: deploy
cache: {}
script:
- pip install twine build
- python3 -m build --sdist --wheel .
- twine upload dist/*
only:
- tags
# # this is now done automatically by conda-forge
# conda:
# image: ubuntu:latest
# stage: deploy
# cache: {}
# before_script:
# ## install os tools
# - apt-get update -q && apt-get install -q -y --no-install-recommends make sed curl git python3 --reinstall ca-certificates
# - update-ca-certificates
# ## setup ssh
# - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# - eval $(ssh-agent -s)
# - echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
# - git config --global user.name "${GITLAB_USER_NAME}"
# - git config --global user.email "${GITLAB_USER_EMAIL}"
# - ssh-keyscan github.com >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
# script:
# - make conda-ci
# only:
# - tags