diff --git a/.travis.yml b/.travis.yml index 0f74c56acf592..49816709b38ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,35 +19,54 @@ addons: - libsfml-dev before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install boehmgc; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sfml; fi + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew update + brew install boehmgc + brew install sfml + fi before_script: - - set -e - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then unset -f cd; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then shell_session_update() { :; }; fi - - git clone --depth 1 https://github.com/nim-lang/csources.git - - cd csources - - sh build.sh - - cd .. - - export PATH=$(pwd)/bin${PATH:+:$PATH} + - | + if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH" + fi + export SKIPTESTS="false" + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(\.txt$)(\.rst)|(^(doc|icons|web|))/' || { + echo "Only the docs were updated, the tests will not run." + export SKIPTESTS="true" + } + set -e + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + # see https://github.com/travis-ci/travis-ci/issues/8703#issuecomment-389117994 + unset -f cd + shell_session_update() { :; }; + fi + git clone --depth 1 https://github.com/nim-lang/csources.git + cd csources + sh build.sh + cd .. + export PATH=$(pwd)/bin${PATH:+:$PATH} script: - - nim c koch - - ./koch boot - - ./koch boot -d:release - - ./koch nimble - - nim e tests/test_nimscript.nims - - nimble install zip -y - - nimble install opengl - - nimble install sdl1 - - nimble install jester@#head -y - - nimble install niminst - - nim c --taintMode:on -d:nimCoroutines tests/testament/tester - - tests/testament/tester --pedantic all -d:nimCoroutines - - nim c -o:bin/nimpretty nimpretty/nimpretty.nim - - nim c -r nimpretty/tester.nim - - ./koch web - - ./koch csource - - ./koch nimsuggest - - nim c -r nimsuggest/tester + - | + set -e + nim c koch + ./koch boot + ./koch boot -d:release + if [ "$SKIPTESTS" != "true" ]; then + ./koch nimble + nim e tests/test_nimscript.nims + nimble install zip -y + nimble install opengl + nimble install sdl1 + nimble install jester@#head -y + nimble install niminst + nim c --taintMode:on -d:nimCoroutines tests/testament/tester + tests/testament/tester --pedantic all -d:nimCoroutines + nim c -o:bin/nimpretty nimpretty/nimpretty.nim + nim c -r nimpretty/tester.nim + ./koch csource + ./koch nimsuggest + fi + ./koch web + nim c -r nimsuggest/tester