-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
94 lines (87 loc) · 2.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
stages:
- lint
- build
- doc
- deploy
lint:
stage: lint
image: registry.gitlab.com/dannywillems/docker-ocamlformat:0.15.0
before_script:
- eval $(opam env)
script:
- ocamlformat --check test/*.ml*
- ocamlformat --check src/*.ml*
.build-test: &build_definition
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
- sudo apt-get install m4 -y
# Install NVM for the JS test
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- export NVM_DIR="$HOME/.nvm"
- . "$NVM_DIR/nvm.sh"
- nvm install 12.18.3
- nvm use 12.18.3
script:
- opam install --deps-only -y .
# Install the package
- opam install .
# Run tests
- dune build
# js_of_ocaml compatibility
- node _build/default/test/test_bigint.bc.js
- node _build/default/test/test_number.bc.js
- node _build/default/test/test_array_buffer.bc.js
- node _build/default/test/test_es_module.bc.js
build-ocaml-4.08:
<<: *build_definition
image: ocaml/opam2:4.08
build-ocaml-4.09:
<<: *build_definition
image: ocaml/opam2:4.09
build-ocaml-4.10:
<<: *build_definition
image: ocaml/opam2:4.10
# Build the documentation, but do not publish
doc:
stage: doc
image: ocaml/opam2:4.09
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
- 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:
- if: '$CI_COMMIT_BRANCH != "master"'
pages:
stage: deploy
image: ocaml/opam2:4.09
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
- sudo apt-get install m4 -y
- opam install odoc -y
- opam install . -y
script:
- dune build @doc
- cp -r _build/default/_doc/_html public/
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == "master"'