Skip to content

Implement installation using trust #116

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

Merged
merged 7 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
language: rust

env:
Copy link
Author

@jamesmunns jamesmunns Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This env was replaced if one is defined in the matrix. This meant that previously this flag was only set on Windows builds.

- RUSTFLAGS="-D warnings"

matrix:
fast_finish: true
include:
- rust: nightly
os: linux
env: BUILD_DOCS=1 BUILD_BOOK=1
env: RUSTFLAGS="-D warnings" BUILD_DOCS=1 BUILD_BOOK=1
- rust: nightly
os: osx
osx_image: xcode9.2
env: BUILD_DOCS=1
env: RUSTFLAGS="-D warnings" BUILD_DOCS=1
- rust: nightly-x86_64-pc-windows-msvc
os: windows
env: RUSTFLAGS="-D warnings"

before_script:
- rustup component add rustfmt
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.3" mdbook)
- cargo install-update -a
- if [[ -n "$BUILD_BOOK" ]]; then (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh); fi

script:
- if ![[ -n "$BUILD_BOOK" ]]; then cargo check --all --benches --bins --examples --tests && cargo test --all; fi
- if [[ -n "$BUILD_BOOK" ]]; then cargo test --all --benches --bins --examples --tests; fi
- if ! [[ -n "$BUILD_BOOK" ]]; then cargo check --all --benches --bins --examples --tests && cargo test --all; fi
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

![[ is treated differently than ! [[. The latter is what we wanted.

- if [[ -n "$BUILD_BOOK" ]]; then cargo test --all --benches --bins --examples --tests; fi
- cargo fmt --all -- --check
- if [[ -n "$BUILD_DOCS" ]]; then cargo doc --features docs; fi
- if [[ -n "$BUILD_BOOK" ]]; then mdbook build docs && mdbook test -L ./target/debug/deps docs; fi
- if [[ -n "$BUILD_DOCS" ]]; then cargo doc --features docs; fi
- if [[ -n "$BUILD_BOOK" ]]; then mdbook build docs && mdbook test -L ./target/debug/deps docs; fi
19 changes: 19 additions & 0 deletions ci/install-mdbook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set -euxo pipefail

# Based on the Rust-Embedded WG's book CI
# https://github.com/rust-embedded/book/blob/master/ci/install.sh

main() {
# Note - this will only accept releases tagged with v0.3.x
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we have semver expectations for the book, but this matches the previous behavior of --version "^0.3"

local tag=$(git ls-remote --tags --refs --exit-code \
https://github.com/rust-lang-nursery/mdbook \
| cut -d/ -f3 \
| grep -E '^v0\.3\.[0-9]+$' \
| sort \
| tail -n1)

curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- --git rust-lang-nursery/mdbook --tag $tag
}

main