diff --git a/.travis.yml b/.travis.yml
index b5d1604..30a30d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,16 @@
language: rust
+
rust:
- stable
- beta
- nightly
+
+matrix:
+ allow_failures:
+ - rust: nightly
+
sudo: false
+
cache:
apt: true
pip: true
@@ -12,9 +19,11 @@ cache:
- target/debug/build
- target/release/deps
- target/release/build
+
install:
- pip install 'travis-cargo<0.2' --user
- export PATH=$HOME/.local/bin:$PATH
+
addons:
apt:
packages:
@@ -22,16 +31,20 @@ addons:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
+
before_script:
- smtp-sink 2525 1000&
+
script:
- travis-cargo build
- travis-cargo test
- travis-cargo doc
-- travis-cargo --only stable doc-upload
+
after_success:
+- ./.travis/doc.sh
+- ./.travis/coverage.sh
- travis-cargo --only nightly bench
-- travis-cargo --only stable coveralls --no-sudo
+
env:
global:
secure: "MaZ3TzuaAHuxmxQkfJdqRfkh7/ieScJRk0T/2yjysZhDMTYyRmp5wh/zkfW1ADuG0uc4Pqsxrsh1J9SVO7O0U5NJA8NKZi/pgiL+FHh0g4YtlHxy2xmFNB5am3Kyc+E7B4XylwTbA9S8ublVM0nvX7yX/a5fbwEUInVk2bA8fpc="
diff --git a/.travis/coverage.sh b/.travis/coverage.sh
new file mode 100755
index 0000000..ab9baaa
--- /dev/null
+++ b/.travis/coverage.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -o errexit
+
+if [ "$TRAVIS_RUST_VERSION" != "stable" ]; then
+ exit 0
+fi
+
+wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
+tar xzf master.tar.gz
+mkdir kcov-master/build
+cd kcov-master/build
+cmake ..
+make
+make install DESTDIR=../tmp
+cd ../..
+ls target/debug
+./kcov-master/tmp/usr/local/bin/kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/lettre-*
diff --git a/.travis/doc.sh b/.travis/doc.sh
new file mode 100755
index 0000000..4470d41
--- /dev/null
+++ b/.travis/doc.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -o errexit
+
+if [ "$TRAVIS_RUST_VERSION" != "stable" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+ exit 0
+fi
+
+cargo clean
+cargo doc --no-deps
+
+git clone --branch gh-pages "https://$TOKEN@github.com/${TRAVIS_REPO_SLUG}.git" deploy_docs
+cd deploy_docs
+
+git config user.email "contact@amousset.me"
+git config user.name "Alexis Mousset"
+
+if [ "$TRAVIS_BRANCH" == "master" ]; then
+ rm -rf master
+ mv ../target/doc ./master
+ echo "" > ./master/index.html
+elif [ "$TRAVIS_TAG" != "" ]; then
+ rm -rf $TRAVIS_TAG
+ mv ../target/doc ./$TRAVIS_TAG
+ echo "" > ./$TRAVIS_TAG/index.html
+
+ latest=$(echo * | tr " " "\n" | sort -V -r | head -n1)
+ if [ "$TRAVIS_TAG" == "$latest" ]; then
+
+ echo "" > index.html
+ fi
+else
+ exit 0
+fi
+
+git add -A .
+git commit -m "Rebuild pages at ${TRAVIS_COMMIT}"
+git push --quiet origin gh-pages
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 32b3e6d..1220447 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,7 +10,9 @@ All code must be formatted using `rustfmt`.
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
+```text
():