Skip to content

Commit 1033385

Browse files
committed
Auto merge of #385 - posborne:gh-pages-docs, r=fiveop
Publish docs to gh-pages, add coveralls, update README See the commit messages for some additional details. This started out with just an update to publish the docs to gh-pages but snowballed into a few other changes along the way.
2 parents 025f94e + 8f461ff commit 1033385

File tree

3 files changed

+75
-46
lines changed

3 files changed

+75
-46
lines changed

.travis.yml

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
1+
#
2+
# Operating Environment
3+
#
14
language: rust
25
sudo: false
36
dist: trusty
47
services:
58
- docker
9+
addons:
10+
apt:
11+
packages:
12+
- gcc-multilib
13+
- libcurl4-openssl-dev
14+
- libelf-dev
15+
- libdw-dev
16+
- binutils-dev
617

718
rust:
819
- 1.1.0 # Oldest supported version
9-
- 1.2.0
10-
- 1.3.0
11-
- 1.4.0
12-
- 1.5.0
13-
- 1.6.0
20+
- 1.7.0
21+
- 1.8.0
1422
- stable
1523
- beta
1624
- nightly
1725

18-
script:
19-
- bash ci/run-travis.sh
20-
26+
#
27+
# Environment Variables and Build Matrix
28+
#
2129
env:
22-
- ARCH=x86_64
23-
- ARCH=i686
30+
global:
31+
- PATH=$HOME/.local/bin:$PATH
32+
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
33+
matrix:
34+
- ARCH=x86_64
35+
- ARCH=i686
2436

25-
os:
37+
os: # OSX included in build matrix explicitly
2638
- linux
2739

28-
addons:
29-
apt:
30-
packages:
31-
- gcc-multilib
32-
3340
# Failures on nightly shouldn't fail the overall build.
3441
matrix:
3542
fast_finish: true
@@ -74,22 +81,27 @@ matrix:
7481
- env: TARGET=mipsel-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
7582
- env: TARGET=arm-linux-androideabi DOCKER_IMAGE=posborne/rust-cross:android
7683

77-
# Deploy documentation to S3 for specific branches. At some
78-
# point, it would be nice to also support building docs for
79-
# a specific tag
80-
deploy:
81-
provider: s3
82-
access_key_id: AKIAIGFX36YKEFRZJAXA
83-
secret_access_key:
84-
secure: Q10KEdtBoYxaGXtt23L00J0obv9fpVWtao8YKFEroZMOmvu8Sq2+9aTNGEQRp2OojOxuu+DjZInJlUDFhq6trmV3kpZH2BF7cNRxiZQpQ2FEmlr6ZpYN38GhcIUKdxXqVwXiASJi6j+vz6QdpaOGCs5lQC3VhM5sn49MFXNUrFU=
85-
bucket: rustdoc
86-
endpoint: "rustdoc.s3-website-us-east-1.amazonaws.com"
87-
skip_cleanup: true
88-
local-dir: target/doc
89-
upload-dir: nix/${TRAVIS_BRANCH}/${TRAVIS_OS_NAME}
90-
acl: public_read
91-
on:
92-
condition: "\"$TRAVIS_RUST_VERSION/$ARCH\" == \"1.1.0/x86_64\""
93-
repo: nix-rust/nix
94-
branch:
95-
- master
84+
85+
#
86+
# Build/Test/Deploy Steps
87+
#
88+
before_script:
89+
- pip install 'travis-cargo<0.2' --user
90+
91+
script:
92+
- bash ci/run-travis.sh
93+
- |
94+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
95+
travis-cargo --only stable doc
96+
fi
97+
98+
after_success:
99+
- |
100+
if [ "$TRAVIS_OS_NAME" = "linux" ] && \
101+
[ "$TRAVIS_RUST_VERSION" = "stable" ] && \
102+
[ "$ARCH" = "x86_64" ]; then
103+
# Upload docs for stable (on master) to gh-pages
104+
travis-cargo --only stable doc-upload
105+
# Measure code coverage using kcov and upload to coveralls.io
106+
travis-cargo coveralls --no-sudo --verify
107+
fi

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
# Rust bindings to *nix APIs
22

3-
Rust friendly bindings to various *nix platform APIs (Linux, Darwin,
3+
[![Build Status](https://travis-ci.org/nix-rust/nix.svg?branch=master)](https://travis-ci.org/nix-rust/nix)
4+
[![crates.io](http://meritbadge.herokuapp.com/nix)](https://crates.io/crates/nix)
5+
6+
[Documentation](https://nix-rust.github.io/nix/nix/index.html)
7+
8+
Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin,
49
...). The goal is to not provide a 100% unified interface, but to unify
510
what can be while still providing platform specific APIs.
611

7-
[![Build Status](https://travis-ci.org/nix-rust/nix.svg?branch=master)](https://travis-ci.org/nix-rust/nix)
8-
[![crates.io](http://meritbadge.herokuapp.com/nix)](https://crates.io/crates/nix)
12+
For many system APIs, Nix provides a safe alternative to the unsafe APIs
13+
exposed by the [libc crate](https://github.com/rust-lang/libc). This is done by
14+
wrapping the libc functionality with types/abstractions that enforce legal/safe
15+
usage.
916

10-
## Documentation
1117

12-
API documentation generated by rustdoc:
18+
As an example of what Nix provides, examine the differences between what is
19+
exposed by libc and nix for the
20+
[gethostname](http://man7.org/linux/man-pages/man2/gethostname.2.html) system
21+
call:
1322

14-
- Linux: [master](http://rustdoc.s3-website-us-east-1.amazonaws.com/nix/master/linux/nix/)
15-
- OS X: [master](http://rustdoc.s3-website-us-east-1.amazonaws.com/nix/master/osx/nix/)
23+
```rust,ignore
24+
// libc api (unsafe, requires handling return code/errno)
25+
pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int;
26+
27+
// nix api (returns a nix::Result)
28+
pub fn gethostname(name: &mut [u8]) -> Result<()>;
29+
```
1630

1731
## Usage
1832

@@ -25,10 +39,14 @@ nix = "0.6.0"
2539

2640
Then, add this to your crate root:
2741

28-
```rust
42+
```rust,ignore
2943
extern crate nix;
3044
```
31-
3245
## Contributing
3346

34-
See [CONTRIBUTING](CONTRIBUTING.md).
47+
Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for
48+
additional details.
49+
50+
## License
51+
52+
Nix is licensed under the MIT license. See [LICENSE](LICENSE) for more details.

ci/run-travis.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ fi
3333
if [ "$DOCKER_IMAGE" = "" ]; then
3434
export RUST_TEST_THREADS=1
3535
curl -sSL "https://raw.githubusercontent.com/carllerche/travis-rust-matrix/master/test" | bash
36-
cargo doc --no-deps
3736
else
3837
export RUST_VERSION=${TRAVIS_RUST_VERSION}
3938
export RUST_TARGET=${TARGET}

0 commit comments

Comments
 (0)