aboutsummaryrefslogtreecommitdiffhomepage
path: root/.gitlab-ci.yml
blob: 03e001f4a919b98443c7b1412f20f39aa5e89817 (plain)
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
image: ocaml/opam:ubuntu

# this doesn't seem to work
cache:
  paths:
    - .opamcache

stages:
  - build
  - test

variables:
  # some default values
  NJOBS: "2"
  COMPILER: "system"
  CAMLP5_VER: "6.14"

  # some useful values
  COMPILER_32BIT: "4.02.3+32bit"

  COMPILER_BLEEDING_EDGE: "4.06.0"
  CAMLP5_VER_BLEEDING_EDGE: "7.03"

  TIMING_PACKAGES: "time python"

  COQIDE_PACKAGES: "libgtk2.0-dev libgtksourceview2.0-dev"
  #COQIDE_PACKAGES_32BIT: "libgtk2.0-dev:i386 libgtksourceview2.0-dev:i386"
  COQIDE_OPAM: "lablgtk-extras"
  COQIDE_OPAM_BE: "lablgtk.2.18.6 lablgtk-extras.1.6"
  COQDOC_PACKAGES: "texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-math-extra texlive-fonts-recommended texlive-fonts-extra latex-xcolor ghostscript transfig imagemagick tipa python3-pip"
  COQDOC_OPAM: "hevea"
  SPHINX_PACKAGES: "bs4 sphinx sphinx_rtd_theme pexpect antlr4-python3-runtime sphinxcontrib-bibtex"


before_script:
  - ls # figure out if artifacts are around
  - printenv
#  - if [ "$COMPILER" = "$COMPILER_32BIT" ]; then sudo dpkg --add-architecture i386; fi
  - if [ -n "${EXTRA_PACKAGES}" ]; then sudo apt-get update -qq && sudo apt-get install -y -qq ${EXTRA_PACKAGES}; fi
  - if [ -n "${PIP_PACKAGES}" ]; then sudo pip3 install ${PIP_PACKAGES}; fi

  # setup cache
  - if [ ! "(" -d .opamcache ")" ]; then mv ~/.opam .opamcache; else mv ~/.opam ~/.opam-old; fi
  - ln -s $(readlink -f .opamcache) ~/.opam

  # the default repo in this docker image is a local directory
  # at the time of 4aaeb8abf it lagged behind the official
  # repository such that camlp5 7.01 was not available
  - opam repository set-url default https://opam.ocaml.org
  - opam update
  - opam switch ${COMPILER}
  - eval $(opam config env)
  - opam config list
  - opam install -j ${NJOBS} -y camlp5.${CAMLP5_VER} ocamlfind num ${EXTRA_OPAM}
  - rm -rf ~/.opam/log/
  - opam list

# TODO figure out how to build doc for installed coq
.build-template: &build-template
  stage: build
  artifacts:
    name: "$CI_JOB_NAME"
    paths:
      - _install_ci
      - config/Makefile
      - test-suite/misc/universes/all_stdlib.v
    expire_in: 1 week
  script:
    - set -e

    - echo 'start:coq.config'
    - ./configure -prefix "$(pwd)/_install_ci" ${EXTRA_CONF}
    - echo 'end:coq.config'

    - echo 'start:coq.build'
    - make -j ${NJOBS} byte
    - make -j ${NJOBS}
    - make test-suite/misc/universes/all_stdlib.v
    - echo 'end:coq:build'

    - echo 'start:coq.install'
    - make install
    - make install-byte
    - cp bin/fake_ide _install_ci/bin/
    - echo 'end:coq.install'

    - set +e
  variables: &build-variables
    EXTRA_CONF: "-native-compiler yes -coqide opt"
    EXTRA_PACKAGES: "$COQIDE_PACKAGES"
    EXTRA_OPAM: "$COQIDE_OPAM"

.warnings-template: &warnings-template
  # keep warnings in test stage so we can test things even when warnings occur
  stage: test
  dependencies: []
  script:
    - set -e

    - echo 'start:coq.config'
    - ./configure -local ${EXTRA_CONF}
    - echo 'end:coq.config'

    - echo 'start:coq.build'
    - make -j ${NJOBS} coqocaml
    - echo 'end:coq:build'

    - set +e
  variables: &warnings-variables
    EXTRA_CONF: "-native-compiler yes -coqide byte -byte-only"
    EXTRA_PACKAGES: "$COQIDE_PACKAGES"
    EXTRA_OPAM: "$COQIDE_OPAM"

.test-suite-template: &test-suite-template
  stage: test
  script:
    - cd test-suite
    - make clean
    # careful with the ending /
    - BIN=$(readlink -f ../_install_ci/bin)/
    - LIB=$(readlink -f ../_install_ci/lib/coq)/
    - make -j ${NJOBS} BIN="$BIN" LIB="$LIB" all
  artifacts:
    name: "$CI_JOB_NAME.logs"
    when: on_failure
    paths:
      - test-suite/logs

.validate-template: &validate-template
  stage: test
  script:
    - cd _install_ci
    - find lib/coq/ -name '*.vo' -print0 > vofiles
    - for regexp in 's/.vo//' 's:lib/coq/plugins:Coq:' 's:lib/coq/theories:Coq:' 's:/:.:g'; do sed -z -i "$regexp" vofiles; done
    - xargs -0 --arg-file=vofiles bin/coqchk -boot -silent -o -m -coqlib lib/coq/

.ci-template: &ci-template
  stage: test
  script:
    - set -e
    - echo 'start:coq.test'
    - make -f Makefile.ci -j ${NJOBS} ${TEST_TARGET}
    - echo 'end:coq.test'
    - set +e
  dependencies:
    - build
  variables: &ci-template-vars
    TEST_TARGET: "$CI_JOB_NAME"
    EXTRA_PACKAGES: "$TIMING_PACKAGES"

build:
  <<: *build-template
  variables:
    EXTRA_CONF: "-with-doc yes"
    EXTRA_PACKAGES: "$COQDOC_PACKAGES"
    EXTRA_OPAM: "$COQDOC_OPAM"
    PIP_PACKAGES: "$SPHINX_PACKAGES"

# no coqide for 32bit: libgtk installation problems
build:32bit:
  <<: *build-template
  variables:
    EXTRA_CONF: "-native-compiler yes"
    EXTRA_PACKAGES: "gcc-multilib"
    COMPILER: "$COMPILER_32BIT"

build:bleeding-edge:
  <<: *build-template
  variables:
    <<: *build-variables
    COMPILER: "$COMPILER_BLEEDING_EDGE"
    CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
    EXTRA_OPAM: "$COQIDE_OPAM_BE"

warnings:
  <<: *warnings-template

# warnings:32bit:
#   <<: *warnings-template
#   variables:
#     <<: *warnings-variables
#     EXTRA_PACKAGES: "$gcc-multilib COQIDE_PACKAGES_32BIT"
#     COMPILER: "$COMPILER_32BIT"

warnings:bleeding-edge:
  <<: *warnings-template
  variables:
    <<: *warnings-variables
    COMPILER: "$COMPILER_BLEEDING_EDGE"
    CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
    EXTRA_OPAM: "$COQIDE_OPAM_BE"

test-suite:
  <<: *test-suite-template
  dependencies:
    - build
  variables:
    EXTRA_PACKAGES: "$TIMING_PACKAGES"

test-suite:32bit:
  <<: *test-suite-template
  dependencies:
    - build:32bit
  variables:
    COMPILER: "$COMPILER_32BIT"
    EXTRA_PACKAGES: "gcc-multilib $TIMING_PACKAGES"

test-suite:bleeding-edge:
  <<: *test-suite-template
  dependencies:
    - build:bleeding-edge
  variables:
    COMPILER: "$COMPILER_BLEEDING_EDGE"
    CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
    EXTRA_PACKAGES: "$TIMING_PACKAGES"

validate:
  <<: *validate-template
  dependencies:
    - build

validate:32bit:
  <<: *validate-template
  dependencies:
    - build:32bit
  variables:
    COMPILER: "$COMPILER_32BIT"
    EXTRA_PACKAGES: "gcc-multilib"

ci-bignums:
  <<: *ci-template

ci-color:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES"

ci-compcert:
  <<: *ci-template

ci-coq-dpdgraph:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_OPAM: "ocamlgraph"
    EXTRA_PACKAGES: "$TIMING_PACKAGES autoconf"

ci-coquelicot:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES autoconf"

ci-elpi:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_OPAM: "ppx_tools_versioned ppx_deriving ocaml-migrate-parsetree"

ci-equations:
  <<: *ci-template

ci-geocoq:
  <<: *ci-template
  allow_failure: true

# ci-fiat-crypto:
#   <<: *ci-template
#   # out of memory error
#   allow_failure: true

ci-fiat-parsers:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES"

ci-flocq:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES autoconf"

ci-formal-topology:
  <<: *ci-template

ci-hott:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES autoconf"

ci-iris-lambda-rust:
  <<: *ci-template

ci-ltac2:
  <<: *ci-template

ci-math-classes:
  <<: *ci-template

ci-math-comp:
  <<: *ci-template

ci-sf:
  <<: *ci-template
  variables:
    <<: *ci-template-vars
    EXTRA_PACKAGES: "$TIMING_PACKAGES wget"

ci-unimath:
  <<: *ci-template

ci-vst:
  <<: *ci-template