diff --git a/.travis.yml b/.travis.yml index da7d1e3ee488931a58c1dcae0ed5aab13c986726..25b902d3b377a648c18cad6962cf51f01e9e5828 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: cpp cache: - directories: - - $HOME/.ccache - - $HOME/.cache/pip + - pip + - ccache + - yarn sudo: required dist: trusty os: @@ -19,8 +19,11 @@ addons: - python-wheel - clang-format-3.8 - ccache + - npm + - nodejs + script: - /bin/bash ./tests.sh + /bin/bash ./tests.sh all notifications: email: diff --git a/tests.sh b/tests.sh index 7e51cb30e28d1597a5aa70db7fb64e3e46f6b3b9..961e2f592f1decd5827c9d57b80dc8cd2158798a 100644 --- a/tests.sh +++ b/tests.sh @@ -1,13 +1,33 @@ #!/bin/bash set -ex -sudo pip install numpy -#sudo apt-get install --only-upgrade cmake -y -mkdir -p build -cd build -cmake .. -make -make test - -#if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/run_on_pull_requests; fi -#if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/run_on_non_pull_requests; fi +mode=$1 +cur=$(pwd) + +backend_test() { + cd $cur + sudo pip install numpy + mkdir -p build + cd build + cmake .. + make + make test +} + +frontend_test() { + cd $cur + cd frontend + npm install + npm run build +} + +echo "mode" $mode + +if [ $mode = "backend" ]; then + backend_test +elif [ $mode = "all" ]; then + frontend_test + backend_test +else + frontend_test +fi