From 674680fee0ad5d3084da384285b19c6a24b2147c Mon Sep 17 00:00:00 2001 From: David Adeboye Date: Thu, 18 Oct 2018 10:17:17 +0100 Subject: [PATCH] Enable travis --- .travis.sh | 20 ++++++++++++++++++++ .travis.yml | 21 ++++++++++----------- Makefile | 12 +++--------- README.md | 5 ++++- _tags | 3 ++- src/Parliament.odocl | 1 - src/{ => main}/Parliament.ml | 3 +-- src/main/Parliament.mllib | 2 ++ src/main/Parliament.odocl | 2 ++ src/main/Worker/Parliament_worker.ml | 9 +++++++++ src/tests/ParliamentTest.ml | 10 ++++++++++ 11 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 .travis.sh delete mode 100644 src/Parliament.odocl rename src/{ => main}/Parliament.ml (82%) create mode 100644 src/main/Parliament.mllib create mode 100644 src/main/Parliament.odocl create mode 100644 src/main/Worker/Parliament_worker.ml create mode 100644 src/tests/ParliamentTest.ml diff --git a/.travis.sh b/.travis.sh new file mode 100644 index 0000000..4fc38c0 --- /dev/null +++ b/.travis.sh @@ -0,0 +1,20 @@ +set -e + +OPAM_DEPENDS="ocamlfind ounit" + +echo "yes" | sudo add-apt-repository ppa:avsm/ocaml42+opam12 +sudo apt-get update -qq +sudo apt-get install -qq ocaml-nox ocaml-native-compilers camlp4-extra opam libgsl0-dev libshp-dev libplplot-dev +export OPAMYES=1 +export OPAMVERBOSE=1 +echo OCaml version +ocaml -version +echo OPAM versions +opam --version +opam --git-version + +opam init +opam install ${OPAM_DEPENDS} +eval `opam config env` +make +# make test diff --git a/.travis.yml b/.travis.yml index 63e8644..498a0f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ language: c sudo: required - -install: - - wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh - -script: - - bash -ex .travis-opam.sh - -env: - - OCAML_VERSION=4.07 - +script: +- bash -ex .travis.sh os: - - linux +- linux +deploy: + provider: releases + api_key: + secure: cYtbDIt1q/ed158bqEL7yf0A1eRiPrJTpBCX1/jC1gKqkg9g24pyiyaKxtJS+PRD1uuv8DBnknkZFrVIpB8ftes5YqvZyppT3PaKWMpfxbNpY95DcWhWSqsr1094OOzGbuyXCByMOVHMmIIFq2u65BgDazQ47ZSxekimgZVBjoOPVXC2lkyCWrQPlw9ZU8lG1FZ2ES0OevUnnDewcSJIxDp3nNNOZSUZFMK5NWu3yM+E50y6blZd2vSb238m0wMp5r1oaovGy8zr+/YGi36iFPnNSzD3yPfXFRNnnEi806pmA3gedB8pC1TrAP0qrPFrAnKPSTDrdALTzj6SKUkXfr/JaDIznlNJaaZB8yqx1Hc5LFmBqDbBwjrKbQA0eYii/E+FNtACppGeDUD2JqA9rfVHHqwXaSCWqCERw1U+aqr44JfuiOmqXIjnY0LkPTqYprcWZpqUhBEctcNUx0B6NwrFKhpOiTdySaCwx42gqwBYZm9T9rkr9IUjs88BMbPe1qacw3utfzUbGS663/f5ptX+BShwBWV1zMMqeEWlyfXGIVWD2KiNl2GIXSVdASx/DdwBVqhc9Smdm8WWiZDy+XECDXTFmN7N935lfhY0XM3T5VYWfHjg+/QXuGMCpiIwYkH0ChLdMRCGKojwhKD7OWbmvPTDKBBAu9A41KGF1iI= + file: _build/src/main/Parliament.cmx + on: + branch: master diff --git a/Makefile b/Makefile index bdbd855..7d25207 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,7 @@ LIBS=owl DOCFILE=Parliament # Where everything is stored -SRCDIR=src -DOCDIR=docs +SRCDIR=src/main BUILDDIR=_build # Path separator for the current platform. @@ -22,15 +21,10 @@ BUILDDIR=_build # Uncomment the next line for UNIX platforms. /=/ -# Symbolic links created by this Makefile (DO NOT EDIT). -SYMLINKS=$(PROGRAM) $(PROGRAM).byte $(DOCDIR) - all: byte native -docs: - $(BUILDER) $(SRCDIR)$/$(DOCFILE).docdir/index.html -I $(SRCDIR) -build-dir $(BUILDDIR) byte: - $(BUILDER).byte $(SRCDIR)$/$(PROGRAM).byte -use-ocamlfind + $(BUILDER).byte $(SRCDIR)$/$(PROGRAM).cma -use-ocamlfind native: - $(BUILDER).native $(SRCDIR)$/$(PROGRAM).native -use-ocamlfind + $(BUILDER).native $(SRCDIR)$/$(PROGRAM).cmxa -use-ocamlfind clean: $(BUILDER) -clean -build-dir $(BUILDDIR) diff --git a/README.md b/README.md index 552d828..e65b8dd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # Parliament -Parliament + +https://travis-ci.com/adeboyed/Parliament.svg?token=5Vp3phxq7vtDBfGmVxmm&branch=master + + diff --git a/_tags b/_tags index 9269a2c..f4992ad 100644 --- a/_tags +++ b/_tags @@ -1 +1,2 @@ -<*.ml> or "prog.byte": package(owl), package(num) +"src/main/Worker": include +<*.ml> or "prog.byte": package(num) diff --git a/src/Parliament.odocl b/src/Parliament.odocl deleted file mode 100644 index afc7702..0000000 --- a/src/Parliament.odocl +++ /dev/null @@ -1 +0,0 @@ -Parliament diff --git a/src/Parliament.ml b/src/main/Parliament.ml similarity index 82% rename from src/Parliament.ml rename to src/main/Parliament.ml index 45d073d..4de68f1 100644 --- a/src/Parliament.ml +++ b/src/main/Parliament.ml @@ -2,6 +2,5 @@ * Parliament - A distributed general-purpose cluster-computing framework for OCaml * Copyright (c) 2018-2019 David Adeboye *) - -print_string "Hello world!\n";; +module Worker = Parliament_worker \ No newline at end of file diff --git a/src/main/Parliament.mllib b/src/main/Parliament.mllib new file mode 100644 index 0000000..b036a02 --- /dev/null +++ b/src/main/Parliament.mllib @@ -0,0 +1,2 @@ +Worker/Parliament_worker +Parliament \ No newline at end of file diff --git a/src/main/Parliament.odocl b/src/main/Parliament.odocl new file mode 100644 index 0000000..253115f --- /dev/null +++ b/src/main/Parliament.odocl @@ -0,0 +1,2 @@ +Parliament +Parliament_worker \ No newline at end of file diff --git a/src/main/Worker/Parliament_worker.ml b/src/main/Worker/Parliament_worker.ml new file mode 100644 index 0000000..ba7538a --- /dev/null +++ b/src/main/Worker/Parliament_worker.ml @@ -0,0 +1,9 @@ +(* + * Parliament - A distributed general-purpose cluster-computing framework for OCaml + * Copyright (c) 2018-2019 David Adeboye + *) + + +module Parliament_worker = struct + let empty = [] +end \ No newline at end of file diff --git a/src/tests/ParliamentTest.ml b/src/tests/ParliamentTest.ml new file mode 100644 index 0000000..820eafa --- /dev/null +++ b/src/tests/ParliamentTest.ml @@ -0,0 +1,10 @@ +open OUnit2 +open Parliament + +let tests = "test suite for sum" >::: [ + "empty" >:: (fun _ -> assert_equal 0 (sum [])); + "one" >:: (fun _ -> assert_equal 1 (sum [1])); + "onetwo" >:: (fun _ -> assert_equal 3 (sum [1; 2])); +] + +let _ = run_test_tt_main tests \ No newline at end of file