2018-07-11 00:12:10 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ACTION="$1"
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
travis_install() {
|
|
|
|
# Get bazel.
|
2018-08-19 07:32:04 +08:00
|
|
|
wget https://github.com/bazelbuild/bazel/releases/download/0.16.0/bazel-0.16.0-installer-linux-x86_64.sh
|
|
|
|
chmod +x bazel-0.16.0-installer-linux-x86_64.sh
|
|
|
|
./bazel-0.16.0-installer-linux-x86_64.sh --user
|
2018-07-11 00:12:10 +08:00
|
|
|
echo 'build --jobs=4 --curses=no --verbose_failures' >> $HOME/.bazelrc
|
2018-08-15 04:34:24 +08:00
|
|
|
echo 'build --config=linux' >> $HOME/.bazelrc
|
|
|
|
echo "build --config=$CC" >> $HOME/.bazelrc
|
2018-08-19 07:32:04 +08:00
|
|
|
pip install --user yamllint
|
2018-07-11 00:12:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
travis_script() {
|
2018-08-19 07:32:04 +08:00
|
|
|
bazel test //c-toxcore:license_test
|
|
|
|
bazel test //c-toxcore:readme_test
|
|
|
|
bazel test //c-toxcore:yamllint_test
|
|
|
|
|
2018-08-12 22:24:38 +08:00
|
|
|
# TODO(iphydf): Make tests have a chance to succeed.
|
2018-07-11 00:12:10 +08:00
|
|
|
# Run the tests, but if they fail, at least we should be able to build.
|
2018-08-12 22:24:38 +08:00
|
|
|
# bazel test //c-toxcore/... || bazel build //c-toxcore/...
|
|
|
|
bazel build //c-toxcore/...
|
2018-07-11 00:12:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ "-z" "$ACTION" ]; then
|
|
|
|
"travis_script"
|
|
|
|
else
|
|
|
|
"travis_$ACTION"
|
|
|
|
fi
|