-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from domsj/travis
setup travis build
- Loading branch information
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: c | ||
cache: apt | ||
matrix: | ||
include: | ||
- os: linux | ||
env: OCAML_VERSION=4.02.1 OPAM_VERSION=1.2.2 | ||
|
||
sudo: required | ||
before_install: ./travis.sh before_install | ||
install: ./travis.sh install | ||
script: ./travis.sh script | ||
git: | ||
submodules: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash -xue | ||
|
||
APT_DEPENDS="g++-4.8 build-essential" | ||
APT_OCAML_DEPENDS="ocaml ocaml-native-compilers camlp4-extra opam" | ||
OPAM_DEPENDS="ocamlfind ctypes.0.4.1 ctypes-foreign.0.4.0" | ||
|
||
export OPAMYES=1 | ||
export OPAMVERBOSE=1 | ||
export OPAMCOLOR=never | ||
|
||
before_install () { | ||
echo "Running 'before_install' phase" | ||
|
||
echo "Adding PPA" | ||
sudo add-apt-repository "deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse" | ||
sudo add-apt-repository "deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse" | ||
sudo add-apt-repository --yes ppa:avsm/ocaml42+opam12 | ||
|
||
echo "Updating Apt cache" | ||
sudo apt-get update -qq | ||
|
||
echo "Installing general dependencies" | ||
sudo apt-get install -qq ${APT_DEPENDS} | ||
echo "Installing dependencies" | ||
sudo apt-get install -qq ${APT_OCAML_DEPENDS} | ||
|
||
echo "OCaml versions:" | ||
ocaml -version | ||
ocamlopt -version | ||
|
||
echo "Opam versions:" | ||
opam --version | ||
opam --git-version | ||
} | ||
|
||
install () { | ||
echo "Running 'install' phase" | ||
|
||
opam init | ||
eval `opam config env` | ||
opam update | ||
|
||
opam install ${OPAM_DEPENDS} | ||
|
||
CXX=g++-4.8 ./install_rocksdb.sh | ||
|
||
make build test | ||
} | ||
|
||
script () { | ||
echo "Running 'script' phase" | ||
|
||
./rocks_test.native | ||
} | ||
|
||
case "$1" in | ||
before_install) | ||
before_install | ||
;; | ||
install) | ||
install | ||
;; | ||
script) | ||
script | ||
;; | ||
*) | ||
echo "Usage: $0 {before_install|install|script}" | ||
exit 1 | ||
esac |