gitlab-ci.sh 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  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. opam init --comp="${1:=system}"
  9. eval `opam config env`
  10. # Versions
  11. echo "= Versions ="
  12. echo "opam --version"
  13. opam --version
  14. echo "opam --git-version"
  15. opam --git-version
  16. echo "ocaml -version"
  17. ocaml -version
  18. echo "============"
  19. echo "= Dependancies ="
  20. # ocamlfind is mandatory to build
  21. opam install ocamlfind
  22. # XXX Manually install development dependancies, not yet supported (wait opam 1.3)
  23. opam install alcotest oUnit
  24. # Installing dependancies and testing installation
  25. opam pin add oclaunch-ci .
  26. echo "============"
  27. # Run test if OC_NOTEST is false
  28. if [ ! ${OC_NOTEST} ]; then
  29. # Build OcLaunch only
  30. ./configure
  31. make
  32. else
  33. # Building OcLaunch and running tests
  34. ./configure --enable-tests
  35. make test
  36. # Test the produced binary
  37. oclaunch -version
  38. echo "En" | oclaunch
  39. fi