-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Travis CI: expand to test and deploy for Linux and Mac #118
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,107 @@ | ||
sudo: false | ||
|
||
language: rust | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
matrix: | ||
allow_failure: | ||
- rust: nightly | ||
|
||
env: | ||
global: | ||
secure: l3/qEC4krRerllLQzni8j5AjngFi6pluWvBWj//1mJLoIEYwxlQ9mYxEdd9BqccWWFn3K0bVYCVC/64+tP6sRfLkZCe2gPUtwe7ITwCDbapUxmkiRObVJCs5yMQZt6idyhHUDKAXKgNCrusfI2BM3tKGBfRK7Cnn/R/7p/U9+q7D1sgJtUKp6ypVzK6A3jLNp3dFLFI19a5KmbZMVsaa7tOhtdDJjjr7ebsc9z7HMW5/OItiWU3FSauVQQlUMaCiEgFuIG7H7OnBAYWB/gNEtLuwfLqU9UjtWk/njNNRnmJ7m3y5HbQhv5H5F5mJUOq9XFlPLwPwyTeVztSGdQm6k8Pp2pgKBUjY27afBl9BWU+msmN6k0oXfhvIebiBPe/x2udiKeFik1xqOOEU1q9dF0sZiuPxCSM1n7tgWklJ8epgaRQaMPPQw9pO/2H5/ynHCJqBlw6WcdiqWtwAyyr/GEx62u/cg5IVkqb7KLmYsWzjS8wYG4CYs1eIxCw2xPZxP0FGuUXvxTBUPipFze6Z7FqxVauXtVe2D7c1P4738HZP660rmR0GYtHtKLny1QxCCK9sxd9JmcezFCSz4YeQ1od9xc0OzGJ2ullKNGizmGfYmgL6X8faNylLIEdaiHAcY16xV3L0g3fXL1Qg360UHQyj7GIv+0nqQnf+H9xRTTU= | ||
addons: | ||
apt: | ||
packages: | ||
- nodejs | ||
- npm | ||
- PROJECT_NAME=mdBook | ||
|
||
matrix: | ||
include: | ||
# Stable channel | ||
# TODO re-enable the i686-apple-darwin target when passcod/rsnotify#53 is fixed | ||
#- os: osx | ||
#env: TARGET=i686-apple-darwin | ||
#rust: stable | ||
- os: linux | ||
env: TARGET=i686-unknown-linux-gnu | ||
rust: stable | ||
addons: | ||
apt: | ||
packages: &i686_unknown_linux_gnu | ||
- gcc-multilib | ||
- os: osx | ||
env: TARGET=x86_64-apple-darwin | ||
rust: stable | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: stable | ||
addons: | ||
apt: | ||
packages: | ||
- nodejs | ||
- npm | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-musl | ||
rust: stable | ||
# Beta channel | ||
#- os: osx | ||
#env: TARGET=i686-apple-darwin | ||
#rust: beta | ||
- os: linux | ||
env: TARGET=i686-unknown-linux-gnu | ||
rust: beta | ||
addons: | ||
apt: | ||
packages: *i686_unknown_linux_gnu | ||
- os: osx | ||
env: TARGET=x86_64-apple-darwin | ||
rust: beta | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: beta | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-musl | ||
rust: beta | ||
# Nightly channel | ||
#- os: osx | ||
#env: TARGET=i686-apple-darwin | ||
#rust: nightly | ||
- os: linux | ||
env: TARGET=i686-unknown-linux-gnu | ||
rust: nightly | ||
addons: | ||
apt: | ||
packages: *i686_unknown_linux_gnu | ||
- os: osx | ||
env: TARGET=x86_64-apple-darwin | ||
rust: nightly | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: nightly | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-musl | ||
rust: nightly | ||
|
||
install: | ||
- npm install stylus nib | ||
- sh ci/install.sh | ||
|
||
script: | ||
- sh ci/script.sh | ||
|
||
after_success: | ||
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh | ||
- test $TRAVIS_PULL_REQUEST == "false" && | ||
test $TRAVIS_BRANCH == "master" && | ||
test $TARGET == "x86_64-unknown-linux-gnu" && | ||
test $TRAVIS_RUST_VERSION = "stable" && | ||
npm install stylus nib && | ||
bash deploy.sh | ||
|
||
before_deploy: | ||
- sh ci/before_deploy.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: Z1k7WqX7z+tT4+SzTh4tBBzf11VaADB4AWuEczHtylaEb/0hRs8gaiHCNSVHm/QTp0QPWQR2Vw7uKMhVuxG7I8X7h31j3A7ulYBh/iVk0DVIrtrn2Q4WOED9CpoXLuLtk2nxo9MBViFW7mw4nJe9H2Tn9o/9oEYBuwzekvW5mh4muqUuCVTr8eQVYbs3jbC9pQy5oYjOLeUnlL9Cey5VN/nAhzAtyFP+6lIMri0PKit4JtkFou/O1MEpFYlP3VGC2lFiWuByocPKBT/L45FecS9qoHq+i6+ZCPDH2eu46nuYsDbLKAkPdGvf1MdPBPwoj0vSnZbgaTisQ4hIoBngQQQPZlPaGtcdd6g6asxSfnbA9cQhClI5oZJmg+ksxQE+peE8pnbmZ10Ix0PpIkkfWdQeMdUUCQarOTkTK54Munw+X+kp1lH19j6+krQPLBYr95fPRd4b5tWsJD2+pb/UOYFEEJxMNoUHyLCrtdCO7imOwrSUcv51+Z8UudqfPpKQeszrJcntL4owip35r3sF5TsE9YfW5qssLC164IylvP32y1AcfL1jqg8b+zrqLZKanjvDOJ1dtHHuwKqxcwf7PhAf0YjAtVSH9OIYcDzmDa0EMLrq7EK0fs6NAeb5qt6CML7pZrRS3fmOxN53Fbmj81qm6TmjQjDe4dmZlELgNow= | ||
file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz | ||
# don't delete the artifacts from previous phases | ||
skip_cleanup: true | ||
# deploy when a new tag is pushed | ||
on: | ||
condition: $TRAVIS_RUST_VERSION = stable | ||
tags: true | ||
|
||
notifications: | ||
email: | ||
on_success: never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# `before_deploy` phase: here we package the build artifacts | ||
|
||
set -ex | ||
|
||
cargo build --target $TARGET --release | ||
|
||
mkdir staging | ||
|
||
cp target/$TARGET/release/mdbook staging | ||
|
||
cd staging | ||
|
||
tar czf ../${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# `install` phase: install stuff needed for the `script` phase | ||
|
||
set -ex | ||
|
||
case $TARGET in | ||
# Install standard libraries needed for cross compilation | ||
i686-apple-darwin | \ | ||
i686-unknown-linux-gnu | \ | ||
x86_64-unknown-linux-musl) | ||
case $TRAVIS_RUST_VERSION in | ||
stable) | ||
# e.g. 1.6.0 | ||
version=$(rustc -V | cut -d' ' -f2) | ||
;; | ||
*) | ||
version=$TRAVIS_RUST_VERSION | ||
;; | ||
esac | ||
tarball=rust-std-${version}-${TARGET} | ||
|
||
curl -Os http://static.rust-lang.org/dist/${tarball}.tar.gz | ||
|
||
tar xzf ${tarball}.tar.gz | ||
|
||
${tarball}/install.sh --prefix=$(rustc --print sysroot) | ||
|
||
rm -r ${tarball} | ||
rm ${tarball}.tar.gz | ||
;; | ||
# Nothing to do for native builds | ||
*) | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# `script` phase: you usually build, test and generate docs in this phase | ||
|
||
set -ex | ||
|
||
case "$TRAVIS_OS_NAME" in | ||
linux) | ||
host=x86_64-unknown-linux-gnu | ||
;; | ||
osx) | ||
host=x86_64-apple-darwin | ||
;; | ||
esac | ||
|
||
# NOTE Workaround for rust-lang/rust#31907 - disable doc tests when crossing | ||
if [ "$host" != "$TARGET" ]; then | ||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
brew install gnu-sed --default-names | ||
fi | ||
|
||
find src -name '*.rs' -type f | xargs sed -i -e 's:\(//.\s*```\):\1 ignore,:g' | ||
fi | ||
|
||
cargo build --target $TARGET --verbose | ||
cargo test --target $TARGET --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,13 @@ cargo doc | |
|
||
echo -e "${CYAN}Running mdbook build${NC}" | ||
# Run mdbook to generate the book | ||
target/debug/mdbook build book-example/ | ||
target/$TARGET/debug/mdbook build book-example/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: we need target/$TARGET instead of just target in all these instances because mdbook was compiled with |
||
|
||
echo -e "${CYAN}Copying book to target/doc${NC}" | ||
# Copy files from rendered book to doc root | ||
cp -R book-example/book/* target/doc/ | ||
cp -R book-example/book/* target/$TARGET/doc/ | ||
|
||
cd target/doc | ||
cd target/$TARGET/doc | ||
|
||
echo -e "${CYAN}Initializing Git${NC}" | ||
git init | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this right, this is meant to:
npm install stylus nib
is only needed for this deploy script?