Skip to content

Commit

Permalink
Merge pull request #33 from ChunweiYan/feature/apply_frontend_travis_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn authored Dec 27, 2017
2 parents 916f2da + 545e1b0 commit 00ec2f4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: cpp
cache:
directories:
- $HOME/.ccache
- $HOME/.cache/pip
- pip
- ccache
- yarn
sudo: required
dist: trusty
os:
Expand All @@ -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:
Expand Down
40 changes: 30 additions & 10 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 00ec2f4

Please sign in to comment.