Skip to content

Commit

Permalink
chore: coverage setup for coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoonroad committed Apr 5, 2018
1 parent 6ba5a09 commit a74d3f9
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ _build/
.merlin
*.install
jbuild-workspace
_coverage/
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
language: c
sudo: required
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
script: bash -ex .travis-opam.sh

script:
- bash -ex .travis-opam.sh
- "`opam config var bin`/ocveralls --prefix _build `find . -name 'bisect*.out'` --send"

env:
- OCAML_VERSION=4.03 PACKAGE=cuid UPDATE_GCC_BINUTILS=1
- OCAML_VERSION=4.04 PACKAGE=cuid UPDATE_GCC_BINUTILS=1
- OCAML_VERSION=4.05 PACKAGE=cuid UPDATE_GCC_BINUTILS=1
- OCAML_VERSION=4.06 PACKAGE=cuid UPDATE_GCC_BINUTILS=1
- OCAML_VERSION=4.03 PACKAGE=cuid UPDATE_GCC_BINUTILS=1 BISECT_ENABLE=YES BISECT_SILENT=YES
- OCAML_VERSION=4.04 PACKAGE=cuid UPDATE_GCC_BINUTILS=1 BISECT_ENABLE=YES BISECT_SILENT=YES
- OCAML_VERSION=4.05 PACKAGE=cuid UPDATE_GCC_BINUTILS=1 BISECT_ENABLE=YES BISECT_SILENT=YES
- OCAML_VERSION=4.06 PACKAGE=cuid UPDATE_GCC_BINUTILS=1 BISECT_ENABLE=YES BISECT_SILENT=YES

os:
- linux
Expand Down
42 changes: 26 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
.PHONY: build clean test doc
# .PHONY: build clean test doc

all: build

# boot should install the opam tool as well

update-vendor:
opam update --yes
opam upgrade jbuilder --yes
opam upgrade core --yes
opam upgrade cryptokit --yes
opam upgrade alcotest --yes
opam upgrade odoc --yes
opam upgrade odig --yes
opam upgrade re --yes
opam update --yes
opam upgrade jbuilder --yes
opam upgrade core --yes
opam upgrade alcotest --yes
opam upgrade odoc --yes
opam upgrade odig --yes
opam upgrade re --yes
opam upgrade bisect_ppx --yes
opam upgrade ocveralls --yes

vendor:
opam install jbuilder --yes
opam install core --yes
opam install cryptokit --yes
opam install alcotest --yes
opam install odoc --yes
opam install odig --yes
opam install re --yes
opam install jbuilder --yes
opam install core --yes
opam install alcotest --yes
opam install odoc --yes
opam install odig --yes
opam install re --yes
opam install bisect_ppx --yes
opam install ocveralls --yes

build:
jbuilder build --dev
Expand All @@ -39,7 +41,10 @@ cleanup:
rm -fv .*.un~
rm -fv lib/.*.un~
rm -fv lib_test/.*.un~
rm -f `find . -name 'bisect*.out'`


.PHONY: clean
clean: cleanup
jbuilder clean

Expand All @@ -49,4 +54,9 @@ install: build
uninstall:
jbuilder uninstall

.PHONY: coverage
coverage: clean
BISECT_ENABLE=YES jbuilder runtest --dev
bisect-ppx-report -I _build/default/ -text - `find . -name 'bisect*.out'`

# END
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cuid
CUID generator for OCaml.

[![Build Status](https://travis-ci.org/marcoonroad/ocaml-cuid.svg?branch=master)](https://travis-ci.org/marcoonroad/ocaml-cuid)
[![Coverage Status](https://coveralls.io/repos/github/marcoonroad/ocaml-cuid/badge.svg?branch=master)](https://coveralls.io/github/marcoonroad/ocaml-cuid?branch=master)

For further information, please refer to http://usecuid.org

Expand Down
16 changes: 10 additions & 6 deletions cuid.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ build: [
[ "jbuilder" "build" "-p" name "-j" jobs ]
]

build-test: [ "jbuilder" "runtest" "--dev" "-p" name "-j" jobs ]
build-test: [ make "coverage" ]
install: [ make "install" ]
remove: [ "ocamlfind" "remove" "cuid" ]

depends: [
"alcotest" {test}
"re" {test}
"jbuilder" {build}
"core" {build}
"lwt" {build}
"alcotest" {test}
"re" {test}
"jbuilder" {build}
"core" {build}
"lwt" {build}
"bisect_ppx" {>= "1.3.0"}
"ocveralls" {build}
"ocaml-migrate-parsetree"
"ppx_tools_versioned"
]
3 changes: 3 additions & 0 deletions lib/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
(library
((name cuid)
(public_name cuid)
(synopsis "CUID generator for OCaml.")
(wrapped false)
(preprocess (pps (bisect_ppx -conditional)))
(libraries (core unix))))

0 comments on commit a74d3f9

Please sign in to comment.