-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
109 lines (98 loc) · 2.63 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
stages:
- lint
- build
- doc
- coverage
- deploy
lint:
stage: lint
image: ocaml/opam:debian-ocaml-4.12
before_script:
- opam install ocamlformat.0.24.1 -y
script:
- dune build @fmt
rules:
- when: always
.build-definition-debian: &build_definition_debian
stage: build
before_script:
# Always update system package manager + setup OPAM env
- sudo apt-get update && sudo apt-get upgrade -y
- eval $(opam env)
- opam repository set-url default https://opam.ocaml.org
- opam update
- opam depext -i -y zarith
script:
- opam install --deps-only --with-test -y .
# Install the package
- opam install . -y
# Run tests
- dune runtest
rules:
- when: always
build-ocaml-4.11-debian-10:
<<: *build_definition_debian
image: ocaml/opam:debian-10-ocaml-4.11
build-ocaml-4.12-debian-10:
<<: *build_definition_debian
image: ocaml/opam:debian-10-ocaml-4.12
build-ocaml-4.13-debian-10:
<<: *build_definition_debian
image: ocaml/opam:debian-10-ocaml-4.13
build-ocaml-4.11-debian-11:
<<: *build_definition_debian
image: ocaml/opam:debian-11-ocaml-4.11
build-ocaml-4.12-debian-11:
<<: *build_definition_debian
image: ocaml/opam:debian-11-ocaml-4.12
build-ocaml-4.13-debian-11:
<<: *build_definition_debian
image: ocaml/opam:debian-11-ocaml-4.13
doc:
stage: doc
image: ocaml/opam:debian-ocaml-4.12
before_script:
- sudo apt-get update && sudo apt-get upgrade -y
- eval $(opam env)
- opam repository set-url default https://opam.ocaml.org
- opam update
- opam depext -i -y zarith
- sudo apt-get install m4 -y
- opam install odoc -y
- opam install . -y
script:
- dune build @doc
- cp -r _build/default/_doc/_html _odoc/
artifacts:
paths:
- _odoc
rules:
- when: always
# Coverage
coverage:
stage: coverage
image: ocaml/opam:debian-ocaml-4.12
rules:
- when: always
before_script:
- sudo apt-get install m4 jq curl -y
- eval $(opam env)
- opam repository set-url default https://opam.ocaml.org
- opam update
- opam depext -i -y zarith
- opam install -y --with-test .
script:
- dune runtest --instrument-with bisect_ppx --force
- bisect-ppx-report coveralls coverage-raw.json --coverage-path _build/default/
- ./_ci/coverage_metadata_glci.sh coverage-raw.json > coverage_glci.json
- curl --location --request POST 'https://coveralls.io/api/v1/jobs' --form 'json_file=@coverage_glci.json'
pages:
stage: deploy
image: ocaml/opam:debian-ocaml-4.12
script:
- cp -r _odoc public/
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == "master"'