diff --git a/.travis.yml b/.travis.yml index 46f4fc37..62059e3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -install: git clone https://github.com/sstephenson/bats.git -script: bats/bin/bats --tap test plugins/python-build/test +install: git clone --depth 1 https://github.com/sstephenson/bats.git +script: script/test language: c notifications: email: diff --git a/Makefile b/Makefile index fc3a6032..ef8946e6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ test: build/bats/bin/bats - build/bats/bin/bats --tap test plugins/python-build/test + build/bats/bin/bats --tap test + cd plugins/python-build && $(PWD)/build/bats/bin/bats --tap test build/bats/bin/bats: git clone https://github.com/sstephenson/bats.git build/bats diff --git a/script/test b/script/test new file mode 100755 index 00000000..2764644d --- /dev/null +++ b/script/test @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +[ -d ./bats/bin ] && export PATH="$(pwd)"/bats/bin:"$PATH" + +STATUS=0 +bats -t test && ( cd plugins/python-build && bats -t test ) || STATUS="$?" + +#if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -z "$TRAVIS_COMMIT_RANGE" ]; then +# first_sha="$(curl -fsSL https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}.patch | head -1 | awk '{print $2}')" +# export TRAVIS_COMMIT_RANGE="${first_sha}^..${TRAVIS_COMMIT}" +#fi + +#if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then +# ./script/mirror update "$TRAVIS_COMMIT_RANGE" +#elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then +# ./script/mirror verify "$TRAVIS_COMMIT_RANGE" +#fi + +exit "$STATUS"