Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 445d634b authored by MONTAGU Benoit's avatar MONTAGU Benoit
Browse files

added support for CI on gitlab

parent 7145bf8a
No related branches found
No related tags found
No related merge requests found
include: 'https://gitlab.com/gasche/gitlab-ocaml-ci-example/-/raw/main/.gitlab-ci.yml'
.build-matrix:
parallel:
matrix:
- OCAML_COMPILER: ["4.12.1", "4.13.1", "4.14.0", "5.0.0", "5.1.0", "5.2.0"]
DUNE_BUILD_TARGETS: "@all"
DUNE_TEST_TARGETS: "@runtest"
DUNE_DOC_TARGETS: "@doc"
build:
stage: build
extends: .build-matrix # defines OCAML_COMPILER
image: ocaml/opam:debian-testing-ocaml-4.14
tags:
- ci.inria.fr
- small
pages:
stage: deploy
tags:
- ci.inria.fr
- small
variables:
CLEAN_OPAM_CACHE: "false"
CLEAN_DUNE_CACHE: "false"
\ No newline at end of file
.PHONY: all test clean fmt
.PHONY: all clean fmt test doc doc-browse doc-commit-to-pages
all:
dune build @all
test:
dune test --auto-promote
dune build
clean:
dune clean
fmt:
dune fmt --auto-promote
dune build @fmt --auto-promote
test:
dune runtest
doc:
dune build @doc
DOC_PATH := _build/default/_doc/_html
doc-browse: doc
open ${DOC_PATH}/index.html
doc-commit-to-pages: doc
# compute the current commit hash and branch name
@git rev-parse --short HEAD > /tmp/commit
@git rev-parse --abbrev-ref HEAD > /tmp/branch
cp .gitlab-ci.yml /tmp
# move to the 'pages' branch and commit the documentation there
git checkout pages
mkdir -p docs
@git rm --ignore-unmatch -r docs > /dev/null
rm -rf docs
cp -r ${DOC_PATH} docs
@git add docs
# we also update the 'pages' CI script to follow original-branch changes
cp /tmp/.gitlab-ci.yml .
git add .gitlab-ci.yml
@git commit -m "documentation for $$(cat /tmp/branch) ($$(cat /tmp/commit))" \
&& git checkout $$(cat /tmp/branch) \
|| git checkout $$(cat /tmp/branch)
@echo
@echo "The documentation was committed to the 'pages' branch."
@echo "You can now push it with"
@echo " git push origin pages"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment