-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
151 lines (117 loc) · 3 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
image: gyptis/gyptis:dev
variables:
TERM: "xterm"
DISPLAY: ":99.0"
PYVISTA_OFF_SCREEN: "true"
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
include:
- template: Code-Quality.gitlab-ci.yml
stages:
- badge
- zenodo
- trigdoc
- trigdocker
- test
- deploy
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 ./docs/_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\":\"d25f5f\", \"labelColor\":\"dedede\", \"style\":\"for-the-badge\"} > logobadge.json
artifacts:
paths:
- badges.json
- logobadge.json
container:
stage: trigdocker
trigger: gyptis/docker
only:
- tags
staging:
stage: trigdoc
trigger: gyptis/gyptis.gitlab.io
only:
- tags
.test-script: &test-script
- mamba env update -f environment.yml
- conda activate gyptis
- python --version
- pip install -e .
- make test-req
- make test
- coverage xml
.test:
stage: test
script:
- source ~/.bashrc
- *test-script
only:
- master
# test-python-3.8:
# extends: .test
# before_script:
# - sed -i 's/python>3.7/python=3.8/g' environment.yml
# test-python-3.9:
# extends: .test
# before_script:
# - sed -i 's/python>3.7/python=3.9/g' environment.yml
# test-python-3.10:
# extends: .test
# before_script:
# - sed -i 's/python>3.7/python=3.10/g' environment.yml
# test-python-3.11:
# extends: .test
# before_script:
# - sed -i 's/python>3.7/python=3.11/g' environment.yml
test-python-3.12:
extends: .test
before_script:
- sed -i 's/python>3.7/python=3.12/g' environment.yml
coverage: '/TOTAL.*\s([.\d]+)%/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
send-snapshot:
stage: zenodo
image: python:3.6
script:
- pip install gitlab2zenodo
- git archive --format zip --output ${CI_COMMIT_TAG#v}.zip ${CI_COMMIT_TAG}
- g2z-send -i $zenodo_record -t $zenodo_token -s -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
sonarcloud-check:
stage: test
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
only:
- merge_requests
- master
- develop