Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] [CI] revive stale #6999 : Dont to run the tests if only the docs were updated; travis only for now #8552

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 48 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|))/' || {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 2018. I don't want this never ending Unix grep/awk/shell scripting bullshit.

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