Skip to content

Instantly share code, notes, and snippets.

@herry13
Created August 18, 2014 22:26
Show Gist options
  • Select an option

  • Save herry13/b6ed811709f8a3f0619c to your computer and use it in GitHub Desktop.

Select an option

Save herry13/b6ed811709f8a3f0619c to your computer and use it in GitHub Desktop.
Shell script for building and testing an OCaml project in Travis-CI
#!/bin/bash
#######################################
#
# Bash script file for travis-ci.org.
#
#######################################
OPAM_DEPENDS="ocamlfind yojson"
case "$OCAML_VERSION,$OPAM_VERSION" in
3.12.1,1.0.0) ppa=avsm/ocaml1312+opam10 ;;
3.12.1,1.1.0) ppa=avsm/ocaml1312+opam11 ;;
4.00.1,1.0.0) ppa=avsm/ocaml40+opam10 ;;
4.00.1,1.1.0) ppa=avsm/ocaml40+opam11 ;;
4.01.0,1.0.0) ppa=avsm/ocaml41+opam10 ;;
4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;;
*) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
esac
# install ocaml ubuntu package
echo "yes" | sudo add-apt-repository ppa:$ppa
sudo apt-get update -qq
sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam
export OPAMYES=1
opam init
opam install ${OPAM_DEPENDS}
eval `opam config env`
# build csfp
cd ocaml
make
# run test
make test
@herry13

herry13 commented Aug 18, 2014

Copy link
Copy Markdown
Author

This requires file .travis.yml to be added to the project's root directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment