gitlab-ci.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. # OCaml version is assuming to be set (for instance as system compiler) if
  3. # nothing is passed
  4. # Inspired by https://github.com/ocaml/ocaml-ci-scripts
  5. # Use -y with evry opam command
  6. export OPAMYES=true
  7. # Installing opam
  8. comp=${1:-system}
  9. opam init --comp="${comp}"
  10. eval `opam config env`
  11. # Versions
  12. echo "= Versions ="
  13. echo "opam --version"
  14. opam --version
  15. echo "opam --git-version"
  16. opam --git-version
  17. echo "ocaml -version"
  18. ocaml -version
  19. echo "============"
  20. echo "= Dependancies ="
  21. # ocamlfind is mandatory to build
  22. opam install ocamlfind
  23. # XXX Manually install development dependancies, not yet supported (wait opam 1.3)
  24. opam install alcotest oUnit
  25. # Installing dependancies and testing installation
  26. opam pin add oclaunch .
  27. echo "============"
  28. # Run test if OC_NOTEST is false
  29. if [ ! ${OC_NOTEST} ]; then
  30. # Build OcLaunch only
  31. ./configure
  32. make
  33. else
  34. # Building OcLaunch and running tests
  35. ./configure --enable-tests
  36. make test
  37. # Test the produced binary
  38. oclaunch -version
  39. echo "En" | oclaunch
  40. fi