gitlab-ci.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 and files
  12. echo "Trees"
  13. echo "$PWD"
  14. ls .
  15. echo "$HOME"
  16. ls -a $HOME
  17. echo "= Versions ="
  18. echo "opam --version"
  19. opam --version
  20. echo "opam --git-version"
  21. opam --git-version
  22. echo "ocaml -version"
  23. ocaml -version
  24. echo "============"
  25. echo "= Dependancies ="
  26. # ocamlfind is mandatory to build
  27. opam install ocamlfind
  28. # XXX Manually install development dependancies, not yet supported (wait opam 1.3)
  29. opam install alcotest oUnit
  30. # Installing dependancies and testing installation
  31. opam pin add oclaunch .
  32. echo "============"
  33. # Run test if OC_NOTEST is false
  34. if [ ! ${OC_NOTEST} ]; then
  35. # Build OcLaunch only
  36. ./configure
  37. make
  38. else
  39. # Building OcLaunch and running tests
  40. ./configure --enable-tests
  41. make test
  42. # Test the produced binary
  43. oclaunch -version
  44. echo "En" | oclaunch
  45. fi