diff --git a/.travis.yml b/.travis.yml index ef43de1..4df994e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,13 @@ install: - ./rebar3 update script: - - ./rebar3 eunit + - ./rebar3 compile + - ./rebar3 eunit skip_deps=true - ./rebar3 dialyzer +after_success: + - ./rebar3 coveralls send + notifications: email: recipients: diff --git a/README.md b/README.md index 33d1302..5464325 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # yamerl: YAML 1.2 and JSON parser in Erlang [![Build Status](https://travis-ci.org/yakaz/yamerl.svg?branch=master)](https://travis-ci.org/yakaz/yamerl) +[![Coverage Status](https://coveralls.io/repos/github/yakaz/yamerl/badge.svg?branch=master)](https://coveralls.io/github/yakaz/yamerl?branch=master) [![Hex version](https://img.shields.io/hexpm/v/yamerl.svg "Hex version")](https://hex.pm/packages/yamerl) YAML is a human-friendly data serialization format. The specification diff --git a/rebar.config b/rebar.config index c9d7f17..7422983 100644 --- a/rebar.config +++ b/rebar.config @@ -1,2 +1,12 @@ %% -*-erlang-*- %% vim:ft=erlang: + +%% coveralls.io. +{plugins, [{coveralls, + {git, "https://github.com/markusn/coveralls-erl", + {branch, "master"}}}]}. +{cover_enabled, true}. +{cover_print_enabled, true}. +{cover_export_enabled, true}. +{coveralls_coverdata, "_build/test/cover/eunit.coverdata"}. +{coveralls_service_name, "travis-ci"}. diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..0b3f565 --- /dev/null +++ b/rebar.config.script @@ -0,0 +1,10 @@ +%% vim:ft=erlang: + +case os:getenv("TRAVIS") of + "true" -> + JobId = os:getenv("TRAVIS_JOB_ID"), + lists:keystore(coveralls_service_job_id, 1, CONFIG, + {coveralls_service_job_id, JobId}); + _ -> + CONFIG +end.