diff --git a/.travis.yml b/.travis.yml index 955c0d8..c1beab2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,16 @@ notifications: webhooks: http://basho-engbot.herokuapp.com/travis?key=92c392ada1e45ef632b5df7cf7104e914a3fa999 email: eng@basho.com otp_release: + - 19.2 - R16B02 - R15B01 - R15B +env: + - REBAR_V=2 + - REBAR_V=3 +before_install: + - ./ci before_install "${REBAR_V:?}" +install: + - ./ci install "${REBAR_V:?}" +script: + - ./ci script "${REBAR_V:?}" diff --git a/ci b/ci new file mode 100755 index 0000000..f636e23 --- /dev/null +++ b/ci @@ -0,0 +1,32 @@ +#!/bin/bash + +set -ev # Ref https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps + +case "${1:?}-${2:?}" in + before_install-2) + rebar version + ;; + before_install-3) + ## Travis CI does not support rebar3 yet. See https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490 + curl -f -L -o ./rebar3 https://github.com/erlang/rebar3/releases/download/3.3.6/rebar3 + chmod +x ./rebar3 + ./rebar3 version + ;; + install-2) + rebar get-deps + ;; + install-3) + ./rebar3 deps + ;; + script-2) + rebar compile + test 1 -le $(find . -name syslog_drv.so | wc -l) + rebar eunit + ;; + script-3) + ./rebar3 compile + test 1 -le $(find . -name syslog_drv.so | wc -l) + ./rebar3 eunit + ./rebar3 dialyzer + ;; +esac