-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
128 lines (105 loc) · 2.68 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
variables:
TERM: "xterm"
DISPLAY: ":99.0"
PYVISTA_OFF_SCREEN: "true"
stages:
- badge
- zenodo
- trigdoc
- trigdocker
- test
- deploy
.setup-conda:
script:
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge
- sed -i 's/name protis/name base/g' environment.yml
- conda install mamba
.setup-Xvfb:
script:
- which Xvfb
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- sleep 3
.install-os-tools:
script:
- apt-get update -q && apt-get install -q -y --no-install-recommends make libgl1-mesa-dev xvfb libxrender1
.before-python:
script:
- !reference [.install-os-tools, script]
- !reference [.setup-conda, script]
- !reference [.setup-Xvfb, script]
- make test-req
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\":\"8c4ab0\", \"labelColor\":\"dedede\", \"style\":\"for-the-badge\"} > logobadge.json
artifacts:
paths:
- badges.json
- logobadge.json
only:
- main
staging:
stage: trigdoc
trigger: protis/protis.gitlab.io
only:
- main
container:
stage: trigdocker
trigger: protis/docker
only:
- tags
.tester:
stage: test
image: benvial/protis:latest
before_script:
- !reference [.before-python, script]
only:
- main
test-pip:
extends: .tester
image: condaforge/mambaforge:latest
script:
- pip install -e .[backends]
- make test
test-conda:
extends: .tester
script:
- mamba env update -n base -f environment.yml
- pip install -e .[backends]
- make test
- coverage xml
coverage: '/TOTAL.*\s([.\d]+)%/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
send-snapshot:
stage: zenodo
image: python
script:
- 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 -m .zenodo.json ${CI_COMMIT_TAG#v}.zip
only:
- tags
pypi:
image: python:latest
stage: deploy
cache: {}
script:
- pip install twine build
- python3 -m build --sdist --wheel .
- twine upload dist/*
only:
- tags