This patch modifies the Travis build pipeline to include multiple
[build stages](https://docs.travis-ci.com/user/build-stages/). CI now
progresses in the following steps:
- First, `cargo check` is run on `stable` only.
If it fails, the build is considered failed.
This is so that we can fail fast for obviously botched commits.
- Then, unit and doc tests are run for all targets.
If any non-nightly tests fail, the build fails.
- Then, integration tests with
[GreenMail](http://www.icegreen.com/greenmail/) are run on Linux for
all Rust targets. We can't run them on macOS because it doesn't
support the Docker service.
If any non-nightly tests fail, the build fails.
- Then, `rustfmt` and `clippy` are both run on *beta* and on nightly.
We use beta instead of stable to try to give ourselves some headroom
for changes coming down the pike. The lints are only run on Linux,
because the platform shouldn't matter.
If any beta lints fail, the build fails.
- And finally, we generate a coverage report on nightly on Linux.
This can only run on nightly because tarpaulin requires nightly.
It's only run on Linux, because we want to include integration tests.
Note that the coverage stage has its own cache
(`CACHE_NAME=coverage`) because the only thing it caches is cargo
tarpaulin (the rust/cargo cache is cleaned before exit).
Fixes#48.
Specifically, if a test doesn't clean up nicely after itself, running it
a second time for checking coverage might make it fail! We restart the
docker server so that all the server state is erased, which should
mitigate that.
notes
* i tried to avoid the term "async", because that term is very
overloaded and we're not using e.g. tokio/async-io here
* i'm a little unhappy having to string the channel through the
parser, because that seems rather a part of the client logic than
parsing. on the other hand it's better than passing the whole
client, so there's that at least.