-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (67 loc) · 1.87 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
variables:
GIT_STRATEGY: "fetch"
GIT_DEPTH: "1"
stages:
- build
.build_template: &build_definition
image: ocaml/opam2
stage: build
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- _build
- ~/.opam
artifacts:
name: "$CI_COMMIT_REF_NAME"
paths:
- _build/
expire_in: 1 day
tags:
- gitlab-org
script:
- sudo apt-get update
- sudo apt-get install libbz2-dev -y
- opam init
- opam remote set-url default git://github.com/ocaml/opam-repository.git
- opam depext -iy dune.2.8.2
- opam install . --dry-run --deps-only --locked --with-test --with-doc --yes | awk '/-> installed/{print $3}' | xargs opam depext -iy
- dune build .
- opam clean
build:
<<: *build_definition
image: ocaml/opam2
build403:
<<: *build_definition
image: ocaml/opam2:4.03
# make the linting a separate job because:
# - installing ocamlformat and dependencies from opam takes 5 minutes
# - avoiding to taint the build environment with additional packages
lint:
image: ocaml/opam2
stage: build
script:
- sudo apt-get update
- opam init
- opam remote set-url default git://github.com/ocaml/opam-repository.git
# rebuild .opam to check whether the file in git matches what is
# generated by dune
- opam depext -iy dune.2.8.2 ocamlformat
- dune build camlbz2.opam
- git diff --exit-code
# check whether source code complies with ocamlformat
- dune build @fmt
- opam clean
opam-debian:
image: ocaml/opam:debian
stage: build
script:
- opam remote set-url default git://github.com/ocaml/opam-repository.git
- opam pin add -yn .
- opam depext -uiy --with-test camlbz2
opam-alpine:
image: ocaml/opam:alpine
stage: build
script:
- opam remote set-url default git://github.com/ocaml/opam-repository.git
- opam pin add -yn .
- opam depext -uiy --with-test camlbz2