diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..201117897 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +language: rust + +matrix: + include: + - env: TARGET=x86_64-unknown-linux-gnu + rust: nightly + +before_install: set -e + +install: + - bash ci/install.sh + +script: + - bash ci/script.sh + +after_script: set +e + +after_success: + - bash ci/after_success.sh + +cache: cargo +before_cache: + # Travis can't cache files that are not readable by "others" + - chmod -R a+r $HOME/.cargo + +branches: + only: + - auto + - master + - try + +notifications: + email: + on_success: never diff --git a/ci/after_success.sh b/ci/after_success.sh new file mode 100644 index 000000000..8c4cf0875 --- /dev/null +++ b/ci/after_success.sh @@ -0,0 +1,20 @@ +set -euxo pipefail + +main() { + cargo doc --target $TARGET + + mkdir ghp-import + + curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | \ + tar --strip-components 1 -C ghp-import -xz + + ./ghp-import/ghp_import.py target/$TARGET/doc + + set +x + git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && \ + echo OK +} + +if [ $TRAVIS_BRANCH = master ]; then + main +fi diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 000000000..642d79a96 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,7 @@ +set -euxo pipefail + +main() { + return +} + +main diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 000000000..9e10e88e3 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,7 @@ +set -euxo pipefail + +main() { + cargo check --target $TARGET +} + +main