Split Travis build into stages (#62)

Adds code coverage checking.
This commit is contained in:
Eliza Weisman
2017-09-14 18:33:34 -05:00
committed by Carl Lerche
parent f84a1bdd1f
commit e4b8dde1d3
4 changed files with 63 additions and 23 deletions

View File

@@ -1,43 +1,55 @@
---
language: rust
dist: trusty
sudo: false
cache: cargo
cache:
cargo: true
apt: true
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- libssl-dev
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
install:
- pip install --user travis-cargo codecov && export PATH=$HOME/.local/bin:$PATH
- if ! cargo fmt --help >/dev/null 2>&1 ; then cargo install rustfmt-nightly ; fi
after_script:
# Check formatting
- cargo fmt -- --write-mode=diff
after_success:
- travis-cargo doc-upload
rust:
- nightly
- beta
- stable
script:
# Run tests
- cargo test
# Test examples in readme
- rustdoc --test README.md -L target/debug/deps
# Generate docs
- cargo doc --no-deps
after_success:
# generate kcov coverage data
- travis-cargo coverage --no-sudo
# upload to codecov.io
- codecov --file target/kcov/kcov-merged/cobertura.xml
- bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh)
- cargo tarpaulin --out Xml -- --skip hpack && bash <(curl -s https://codecov.io/bash)
jobs:
allow_failures:
- rust: nightly
include:
- stage: docs
script: cargo doc --no-deps
install: skip
deploy:
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
target_branch: gh-pages
local_dir: target/doc
on:
branch: master
repo: carllerche/h2
rust: nightly
after_success: skip
- stage: fmt
rust: nightly
install: if ! cargo fmt --help >/dev/null 2>&1 ; then cargo install rustfmt-nightly ; fi
script: cargo fmt -- --write-mode=diff
after_success: skip
env:
global:

View File

@@ -3,6 +3,15 @@ name = "h2"
version = "0.1.0"
authors = ["Carl Lerche <me@carllerche.com>"]
[badges.travis-ci]
repository = "carllerche/h2"
branch = "master"
[badges.codecov]
repository = "carllerche/h2"
branch = "master"
service = "github"
[features]
# Enables **unstable** APIs. Any API exposed by this feature has no backwards

View File

@@ -3,6 +3,7 @@
A Tokio aware, HTTP/2.0 client & server implementation for Rust.
[![Build Status](https://travis-ci.org/carllerche/h2.svg?branch=master)](https://travis-ci.org/carllerche/h2)
[![Codecov](https://img.shields.io/codecov/c/github/carllerche/h2.svg)](https://codecov.io/gh/carllerche/h2)
<!-- [![Crates.io](https://img.shields.io/crates/v/h2.svg?maxAge=2592000)](https://crates.io/crates/h2) -->
<!-- [![Documentation](https://docs.rs/h2/badge.svg)][dox] -->

View File

@@ -0,0 +1,18 @@
codecov:
notify:
require_ci_to_pass: true
coverage:
ignore:
- tests/.*
notify:
slack:
default:
url: "https://hooks.slack.com/services/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"
threshold: 1%
only_pulls: false
branches: null
flags: null
paths: null
comment: off