-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
200 lines (175 loc) · 4.97 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
## SPDX-License-Identifier: BSD-3-Clause
## Copyright (C) 2019 Mike Miller
##
## .gitlab-ci.yml - GitLab CI configuration for octave-pythonic
image: registry.gitlab.com/mtmiller/docker-octave:latest
stages:
- build
- test
- release
variables: &variables
CC: gcc-8
CXX: g++-8
CXXFLAGS: "-g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wdate-time -Wextra -Wformat=2"
DEBIAN_FRONTEND: "noninteractive"
DL_LD: g++-8 ## FIXME: drop when Octave version 6 becomes latest
DOCTEST_GIT_REPOSITORY: "https://github.com/catch22/octave-doctest.git"
DOCTEST_GIT_TAG: "v0.7.0"
DOCTEST_ROOT: "/tmp/doctest"
LIBSSL_DEV: "libssl-dev"
PYENV_GIT_REPOSITORY: "https://github.com/pyenv/pyenv.git"
PYENV_GIT_TAG: "v2.0.7"
PYENV_ROOT: "/tmp/pyenv"
PYTHON_CONFIGURE_OPTS: "--enable-shared"
build:
stage: build
script:
- apt-get update && apt-get install -y git
- mkdir -p pkg
- make O=pkg dist dist-zip
artifacts:
paths:
- pkg/*.tar.gz
- pkg/*.zip
.test:pyenv:
stage: test
script:
- apt-get update && apt-get install -y blt-dev g++-8 gcc-8 git libbz2-dev libdb-dev
libffi-dev libgdbm-dev liblzma-dev libncursesw5-dev libreadline-dev libsqlite3-dev
$LIBSSL_DEV tk-dev uuid-dev zlib1g-dev
- git clone $DOCTEST_GIT_REPOSITORY $DOCTEST_ROOT
- git -C $DOCTEST_ROOT checkout $DOCTEST_GIT_TAG
- git clone $PYENV_GIT_REPOSITORY $PYENV_ROOT
- git -C $PYENV_ROOT checkout $PYENV_GIT_TAG
- export PATH=$PYENV_ROOT/bin:$PATH
- eval "$(pyenv init --path)"
- eval "$(pyenv init -)"
- pyenv install $PYTHON_VERSION_FULL
- pyenv global $PYTHON_VERSION_FULL
- mkdir -p python${PYTHON_VERSION}
- make O=python${PYTHON_VERSION} V=1 all
- make O=python${PYTHON_VERSION} V=1 check
- make O=python${PYTHON_VERSION} V=1 doctest OCTAVE_PATH=/tmp/doctest/inst
dependencies: []
artifacts:
paths:
- python${PYTHON_VERSION}/*.log
expire_in: 4 weeks
.test:pkg:
stage: test
script:
- apt-get update && apt-get install -y g++-8 gcc-8 python-dev python3-dev
- octave --eval "pkg install -verbose pkg/octave-pythonic-*.tar.gz"
- octave --eval "d = pkg ('describe', 'pythonic'); assert (d{:}.name, 'pythonic')"
- octave --eval "pkg load pythonic; v = pyversion (); assert (v(1), '${PYTHON_VERSION}')"
dependencies:
- build
coverage:
stage: test
script:
- apt-get update && apt-get install -y g++-8 gcc-8 python3-dev
- pip3 install -U gcovr
- mkdir -p coverage
- make O=coverage V=1 all
- make O=coverage V=1 check
- bash <(curl -S -s https://codecov.io/bash) -x gcov-8 -s coverage -a "-s $PWD/src -r"
- gcovr --gcov-executable gcov-8 --print-summary coverage
variables:
<<: *variables
CXXFLAGS: "-g -O0 --coverage"
PYTHON_VERSION: "3"
dependencies: []
coverage: '/^lines: \d+\.\d+/'
python2.7:
variables:
<<: *variables
PYTHON_VERSION: "2.7"
PYTHON_VERSION_FULL: "2.7.18"
extends: .test:pyenv
python2.7:devel:
extends: python2.7
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.4:
variables:
<<: *variables
LIBSSL_DEV: "libssl1.0-dev"
PYTHON_VERSION: "3.4"
PYTHON_VERSION_FULL: "3.4.10"
extends: .test:pyenv
python3.4:devel:
extends: python3.4
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.5:
variables:
<<: *variables
PYTHON_VERSION: "3.5"
PYTHON_VERSION_FULL: "3.5.10"
extends: .test:pyenv
python3.5:devel:
extends: python3.5
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.6:
variables:
<<: *variables
PYTHON_VERSION: "3.6"
PYTHON_VERSION_FULL: "3.6.15"
extends: .test:pyenv
python3.6:devel:
extends: python3.6
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.7:
variables:
<<: *variables
PYTHON_VERSION: "3.7"
PYTHON_VERSION_FULL: "3.7.12"
extends: .test:pyenv
python3.7:devel:
extends: python3.7
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.8:
variables:
<<: *variables
PYTHON_VERSION: "3.8"
PYTHON_VERSION_FULL: "3.8.12"
extends: .test:pyenv
python3.8:devel:
extends: python3.8
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
python3.9:
variables:
<<: *variables
PYTHON_VERSION: "3.9"
PYTHON_VERSION_FULL: "3.9.7"
extends: .test:pyenv
python3.9:devel:
extends: python3.9
image: registry.gitlab.com/mtmiller/docker-octave:devel
allow_failure: true
pkg:python2:
variables:
<<: *variables
PYTHON_VERSION: 2
extends: .test:pkg
pkg:python3:
variables:
<<: *variables
PYTHON_VERSION: 3
extends: .test:pkg
release:
stage: release
script:
- apt-get update && apt-get install -y curl python-minimal
- sh build-aux/release-create.sh
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+)*/
include:
- template: Code-Quality.gitlab-ci.yml