diff --git a/.travis.yml b/.travis.yml index 4b4e2282..35313dba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: rust script: - - (cd phf && cargo test) - - (cd phf && cargo test --features core) - - (cd phf_macros && cargo test --features stats) +- (cd phf && cargo test) +- (cd phf && cargo test --features core) +- (cd phf_macros && cargo test --features stats) +- ./.travis/build_docs.sh +after_success: + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && ./.travis/update_docs.sh +env: + global: + secure: H8UjXPVRBOF3peqdBwrAS1cvW4TXz9wJCwUqh5K+AP2TbFQAVt9LLkiUySVERRckR7sM/C9m8IE/nhKz7ck8+Dj7tbqd7Jef3dlienpucDF1jpbENyvsshPRvGlvd4jAQCONL9Yxs3MnRnkbr5qI3Gz/JqP7z8jzp5V5Wf7mc/I= diff --git a/.travis/build_docs.sh b/.travis/build_docs.sh new file mode 100755 index 00000000..dd975967 --- /dev/null +++ b/.travis/build_docs.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +mkdir doc + +for crate in $(echo phf_shared phf_macros phf); do + mkdir -p $crate/target + ln -s -t $crate/target ../../doc + (cd $crate && cargo doc --no-deps) +done diff --git a/.travis/update_docs.sh b/.travis/update_docs.sh new file mode 100755 index 00000000..355f75f8 --- /dev/null +++ b/.travis/update_docs.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit -o nounset + +git clone --branch gh-pages "https://$GH_TOKEN@github.com/${TRAVIS_REPO_SLUG}.git" deploy_docs +cd deploy_docs + +git config user.name "Steven Fackler" +git config user.email "sfackler@gmail.com" + +rm -rf doc +mv ../doc . + +git add -A . +git commit -m "rebuild pages at ${TRAVIS_COMMIT}" +git push diff --git a/phf/src/lib.rs b/phf/src/lib.rs index d159b1d5..41d0a435 100644 --- a/phf/src/lib.rs +++ b/phf/src/lib.rs @@ -2,7 +2,7 @@ //! //! Keys can be string literals, byte string literals, byte literals, char //! literals, or any of the fixed-size isizeegral types. -#![doc(html_root_url="https://sfackler.github.io/doc")] +#![doc(html_root_url="https://sfackler.github.io/rust-phf/doc")] #![feature(core)] #![warn(missing_docs)] #![no_std] diff --git a/phf_macros/src/lib.rs b/phf_macros/src/lib.rs index c017c07a..8e8ed6e2 100644 --- a/phf_macros/src/lib.rs +++ b/phf_macros/src/lib.rs @@ -1,7 +1,7 @@ //! Compiler plugin for Rust-PHF //! //! See the documentation for the `phf` crate for more details. -#![doc(html_root_url="http://sfackler.github.io/doc")] +#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")] #![feature(plugin_registrar, quote, rustc_private, hash, core, env)] extern crate rand; diff --git a/phf_shared/src/lib.rs b/phf_shared/src/lib.rs index e9b88439..ac0711b8 100644 --- a/phf_shared/src/lib.rs +++ b/phf_shared/src/lib.rs @@ -1,6 +1,7 @@ #![feature(hash)] #![cfg_attr(feature = "core", feature(core))] #![no_std] +#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")] #[cfg(feature = "core")] extern crate core;